@Override public void afterSim() { t.endTimer(); log.info("Time needed for one iteration (only JDEQSimulation part): " + t.getMeasuredTime() + "[ms]"); }
@Override public void run() { events.initProcessing(); Timer t = new Timer(); t.startTimer(); Scheduler scheduler = new Scheduler(new MessageQueue(), config.getSimulationEndTime()); Road.setAllRoads(new HashMap<Id<Link>, Road>()); // initialize network Road road; for (Link link : this.scenario.getNetwork().getLinks().values()) { road = new Road(scheduler, link); Road.getAllRoads().put(link.getId(), road); } for (Person person : this.scenario.getPopulation().getPersons().values()) { new Vehicle(scheduler, person, activityDurationInterpretation); // the vehicle registers itself to the scheduler } scheduler.startSimulation(); t.endTimer(); log.info("Time needed for one iteration (only JDEQSimulation part): " + t.getMeasuredTime() + "[ms]"); events.finishProcessing(); } }
@Override public void onPrepareSim() { new JDEQSimulation(config, scenario, eventsManager); // Initialize JDEQSim static fields t = new Timer(); t.startTimer(); Road.setAllRoads(new HashMap<Id<Link>, Road>()); // initialize network Road road; for (Link link : this.scenario.getNetwork().getLinks().values()) { road = new Road(scheduler, link); Road.getAllRoads().put(link.getId(), road); } }
public void printMeasuredTime(String label) { System.out.println(label + getMeasuredTime()); } }