public static void disposeEndLegMessage(EndLegMessage message) { if (!JDEQSimConfigGroup.isGC_MESSAGES()) { endLegMessageQueue.add(message); } }
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); } }
public Road(Scheduler scheduler, Link link) { super(scheduler); this.link = link; /* * calculate the maximum number of cars, which can be on the road at the * same time */ this.maxNumberOfCarsOnRoad = Math.round(link.getLength() * NetworkUtils.getNumberOfLanesAsInt(Time.UNDEFINED_TIME, link) * config.getStorageCapacityFactor() / config.getCarSize()); /** * it is assured here, that a road must have the space of at least one * car */ if (this.maxNumberOfCarsOnRoad == 0) { this.maxNumberOfCarsOnRoad = 1; } double maxInverseInFlowCapacity = 3600 / (config.getMinimumInFlowCapacity() * config.getFlowCapacityFactor() * NetworkUtils.getNumberOfLanesAsInt(Time.UNDEFINED_TIME, link)); this.inverseOutFlowCapacity = 1 / (((Link) link).getFlowCapacityPerSec() * config.getFlowCapacityFactor()); if (this.inverseOutFlowCapacity > maxInverseInFlowCapacity) { this.inverseInFlowCapacity = maxInverseInFlowCapacity; } else { this.inverseInFlowCapacity = this.inverseOutFlowCapacity; } this.gapTravelTime = link.getLength() / config.getGapTravelSpeed(); // gap must be initialized to null because of the application logic this.gap = null; }
@Inject public DownstreamSensor(LinkSensorManager sensorManager, Scenario scenario) { this.sensorManager = sensorManager; this.network = scenario.getNetwork(); this.lanes = scenario.getLanes(); this.carSize = scenario.getConfig().jdeqSim().getCarSize(); this.storageCapacityFactor = scenario.getConfig().qsim().getStorageCapFactor(); this.signalsData = (SignalsData) scenario.getScenarioElement(SignalsData.ELEMENT_NAME); init(); }
this.deadlockPreventionMessages.add(vehicle.scheduleDeadlockPreventionMessage( this.deadlockPreventionMessages.getLast().getMessageArrivalTime() + config.getSqueezeTime(), this)); + config.getSqueezeTime(), this));
@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(); } }
this.jdeqSim = new JDEQSimConfigGroup(); this.modules.put(JDEQSimConfigGroup.NAME, this.jdeqSim);
public static void disposeEnterRoadMessage(EnterRoadMessage message) { if (!JDEQSimConfigGroup.isGC_MESSAGES()) { enterRoadMessageQueue.add(message); } }
public static void disposeLeaveRoadMessage(LeaveRoadMessage message) { if (!JDEQSimConfigGroup.isGC_MESSAGES()) { leaveRoadMessageQueue.add(message); } }
public static void disposeDeadlockPreventionMessage(DeadlockPreventionMessage message) { if (!JDEQSimConfigGroup.isGC_MESSAGES()) { deadlockPreventionMessageQueue.add(message); } }
public static void disposeEndRoadMessage(EndRoadMessage message) { if (!JDEQSimConfigGroup.isGC_MESSAGES()) { endRoadMessageQueue.add(message); } }
public static void disposeStartingLegMessage(StartingLegMessage message) { if (!JDEQSimConfigGroup.isGC_MESSAGES()) { startingLegMessageQueue.add(message); } }