/************************************************************************************ * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University * All rights reserved. * Refer to LICENSE for terms and conditions of use. ***********************************************************************************/ package vnsim.vehicular.routePlan; import java.io.File; import java.io.FileInputStream; import java.io.ObjectInputStream; import vnsim.core.Engine; import vnsim.gui.Display; import vnsim.map.object.Globals; import vnsim.map.object.Map; import vnsim.vehicular.simulator.Location; //import testare.LogEntry; //import testare.TestingMain; public class Main { public static void main(String[] args) throws Exception { // long t0, t1; // TestingMain ts = new TestingMain(); String name; name = new String("Reservation"); // name = new String("NJSmall"); // name = new String("DowntownRoutingFull"); // name=new String("downtown"); // name=new String("Highway"); // MakeScenarios.createMap(name, true, true, Globals.routePlanConstants.DYNAMIC_SELF_ROUTE); // String // arg[]={"log0Best.txt","log40Best.txt","log50Best.txt","log100Best.txt"}; // String arg[] = { "log0Best.txt", "log20Best.txt", "log40Best.txt", // "log50Best.txt", "log60Best.txt", "log80Best.txt", // "log100Best.txt" }; // GatherData.getDetailedInfo(arg,"AllRouteInfo.txt"); // String arg[]={Globals.fisOutCar}; // String arg[]={""logIfrRouted.txt""}; // // String arg[] = { // "NJBest40Com100Ah1.txt","NJBest50Com100Ah1.txt","NJBest50Com80Ah1.txt","NJBest50Com80Ah2.txt", // "NJBest80Com100Ah1.txt","NJBest80Com25Ah1.txt","NJBest80Com50Ah1.txt", // "NJBest80Com50Ah3.txt","NJBest80Com75Ah1.txt"}; // // String arg[]={"DRInfrastruct.txt"}; // GatherData.getJustAverages(arg, "AverageValues.txt"); //GatherData.getJustAveragesForDirectory("logIfrRouted.txt", "AverageValues.txt"); // // // adunaRezultatele // readFromFile(name, false); // (new MeasureRouteComputationTime()).measure("routeCompTimes.txt"); // MakeScenarios.createScenarioHighwaySmall(); // MakeScenarios.createScenarioDownTown(); // MakeScenarios.createScenarioHighway(); Location entry = new Location(0, 0); Location exit = new Location(2, 62); MakeScenarios.createSmallReservation(name, entry, exit); } /** * Loads a map file and depending on the value of withRun, displays the map * */ private static void readFromFile(String name, boolean withRun, int type) { try { //File inSave = new File(".//maps//map//" + name + ".map"); File inSave = new File(System.getProperty("user.home") + File.separatorChar + "maps" + File.separatorChar + "map" + File.separatorChar + name + ".map"); ObjectInputStream ois = new ObjectInputStream(new FileInputStream( inSave)); Globals.map = (Map) ois.readObject(); // Globals.map.getMinAndMaxPoint(); // inSave = new File(".\\maps\\spl\\" + name + ".spl"); // ois = new ObjectInputStream(new FileInputStream(inSave)); // Globals.map.mapSpliter = (RoadAreaUtils) ois.readObject(); if (withRun) { Globals.engine = new Engine(true, true); Globals.engine.simulationType=type; Globals.engine.init(); Globals.demo = new Display(); Globals.demo.setVisible(true); } } catch (Exception e) { e.printStackTrace(); } } }