@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(); } }
public void testParametersSetCorrectly() { Config config = super.loadConfig(this.getPackageInputDirectory() + "config.xml"); JDEQSimConfigGroup jdeqSimConfigGroup = ConfigUtils.addOrGetModule(config, JDEQSimConfigGroup.NAME, JDEQSimConfigGroup.class); assertEquals(360.0, jdeqSimConfigGroup.getSimulationEndTime(), EPSILON); assertEquals(2.0, jdeqSimConfigGroup.getFlowCapacityFactor(), EPSILON); assertEquals(3.0, jdeqSimConfigGroup.getStorageCapacityFactor(), EPSILON); assertEquals(3600.0, jdeqSimConfigGroup.getMinimumInFlowCapacity(), EPSILON); assertEquals(10.0, jdeqSimConfigGroup.getCarSize(), EPSILON); assertEquals(20.0, jdeqSimConfigGroup.getGapTravelSpeed(), EPSILON); assertEquals(9000.0, jdeqSimConfigGroup.getSqueezeTime(), EPSILON); } }