@Override public void notifyMobsimBeforeSimStep(@SuppressWarnings("rawtypes") MobsimBeforeSimStepEvent e) { if (e.getSimulationTime() % interval == 0) { times.add(e.getSimulationTime()); timeProfile.add(calculator.calcValues()); } }
@Override public void notifyMobsimBeforeSimStep(MobsimBeforeSimStepEvent e) { Collection<MobsimAgent> agentsToReplan = freightAgentSource.getMobSimAgents(); for (MobsimAgent pa : agentsToReplan) { doReplanning(pa, e.getSimulationTime(), e.getQueueSimulation()); } }
public void fireQueueSimulationBeforeSimStepEvent(double time) { MobsimBeforeSimStepEvent<Mobsim> event = new MobsimBeforeSimStepEvent<>(sim, time); MobsimBeforeSimStepListener[] listener = this.listenerList.getListeners(MobsimBeforeSimStepListener.class); for (MobsimBeforeSimStepListener aListener : listener) { aListener.notifyMobsimBeforeSimStep(event); } }
@Override public void notifyMobsimBeforeSimStep(MobsimBeforeSimStepEvent e) { problem = false ; now = e.getSimulationTime() ; // parallel Execution this.run(e.getSimulationTime()); printInfo(e.getSimulationTime()); }
@Override public void notifyMobsimBeforeSimStep(final MobsimBeforeSimStepEvent e) { if (e.getSimulationTime() == t1) { assertEquals(100, this.arp.getActivityPerformingAgents().size()); // all agents perform an activity before the time step assertEquals(1, this.arp.getActivityEndingAgents(e.getSimulationTime()).size()); // one agent ends an activity if (e.getSimulationTime() == t2) { assertEquals(99, this.arp.getActivityPerformingAgents().size()); // 99 agents perform an activity before the time step assertEquals(1, this.arp.getActivityEndingAgents(e.getSimulationTime()).size()); // one agent ends an activity if (e.getSimulationTime() == t3) { assertEquals(98, this.arp.getActivityPerformingAgents().size()); // 98 agents perform an activity before the time step assertEquals(1, this.arp.getActivityEndingAgents(e.getSimulationTime()).size()); // one agent ends an activity if (e.getSimulationTime() == t4) { assertEquals(97, this.arp.getActivityPerformingAgents().size()); // 97 agents perform an activity before the time step assertEquals(97, this.arp.getActivityEndingAgents(e.getSimulationTime()).size()); // 97 agents end an activity currentActivity.setEndTime(e.getSimulationTime() + 60); WithinDayAgentUtils.resetCaches(agent); this.withinDayEngine.getActivityRescheduler().rescheduleActivityEnd(agent); ((QSim) e.getQueueSimulation()).getEventsManager().processEvent(new ReplanningEvent(e.getSimulationTime(), agent.getId(), "ActivityRescheduler")); currentActivity.setEndTime(e.getSimulationTime() + 120); WithinDayAgentUtils.resetCaches(agent); this.withinDayEngine.getActivityRescheduler().rescheduleActivityEnd(agent); ((QSim) e.getQueueSimulation()).getEventsManager().processEvent(new ReplanningEvent(e.getSimulationTime(), agent.getId(), "ActivityRescheduler")); if (e.getSimulationTime() == t5) { assertEquals(1, this.arp.getActivityPerformingAgents().size()); // one agent performs an activity before the time step
@Override public void notifyMobsimBeforeSimStep(MobsimBeforeSimStepEvent e) { scheduler.doSimStep(e.getSimulationTime()); }
@Override public void notifyMobsimBeforeSimStep(@SuppressWarnings("rawtypes") MobsimBeforeSimStepEvent e) { prebookTrips(e.getSimulationTime()); }
@Override public void notifyMobsimBeforeSimStep(MobsimBeforeSimStepEvent e) { this.signalManager.requestControlUpdate(e.getSimulationTime()); }
@Override public void notifyMobsimBeforeSimStep(MobsimBeforeSimStepEvent e) { double currentTime = e.getSimulationTime(); double startTime = 8. * 60 * 60; double endTime = 12. * 60 * 60; double frequency = 3.; Id<Link> linkId = Id.createLinkId("6"); // The central link if ((currentTime % frequency == 0) && (currentTime >= startTime) && (currentTime <= endTime)) { // LOG.info("Current time = " + currentTime + " -- " + currentTime / 3600.); // for (Id<Link> linkId : links) { eventsManager.processEvent(new MotorizedInteractionEvent(e.getSimulationTime(), linkId, Id.create("evilCar", Vehicle.class))); // } } } }
@Override public void notifyMobsimBeforeSimStep(@SuppressWarnings("rawtypes") MobsimBeforeSimStepEvent e) { if (e.getSimulationTime() % interval == 0) { String time = (int)e.getSimulationTime() + ""; for (T o : monitoredObjects) { Coord coord = calculator.getCoord(o); writer.writeNext(time, o.getId() + "", coord.getX() + "", coord.getY() + "", valuesToStringsConverter.apply(calculator.calculate(o))); } } }
@Override public void notifyMobsimBeforeSimStep(MobsimBeforeSimStepEvent e) { checkLinkTravelTimes(e.getSimulationTime()); }
@Override public void notifyMobsimBeforeSimStep(final MobsimBeforeSimStepEvent e) { if (e.getSimulationTime() == t1) { assertEquals(0, this.lrp.getLegPerformingAgents().size()); // no agent performs a Leg assertEquals(0, this.lrp.getReplanningAgents(e.getSimulationTime()).size()); // no agent needs a replanning } if (e.getSimulationTime() == t2) { assertEquals(1, this.lrp.getLegPerformingAgents().size()); // one performs a Leg assertEquals(0, this.lrp.getReplanningAgents(e.getSimulationTime()).size()); // no agent needs a replanning } if (e.getSimulationTime() == t3) { assertEquals(2, this.lrp.getLegPerformingAgents().size()); // two agents perform a Leg assertEquals(0, this.lrp.getReplanningAgents(e.getSimulationTime()).size()); // no agent needs a replanning } if (e.getSimulationTime() == t4) { assertEquals(3, this.lrp.getLegPerformingAgents().size()); // three agents perform a Leg assertEquals(0, this.lrp.getReplanningAgents(e.getSimulationTime()).size()); // no agent needs a replanning } }