@Override public boolean doSimStep() { double now = context.getSimTimer().getTimeOfDay() ; boolean lanesActive = false; boolean movedWaitToRoad = false; if ( context.qsimConfig.isInsertingWaitingVehiclesBeforeDrivingVehicles() ) { //TODO //Because moveBufferToNextLane() (called from moveLanes()) is kind of "moveInternalNodes()", //it should be executed before moveWaitToRoad() to keep the sequence fully consistent. //The sequence is broken only if isInsertingWaitingVehiclesBeforeDrivingVehicles==true. //Currently, the buffer of the accepting lane gets emptied after moveWaitToRoad(), //which gives preference to already driving vehicles //michalm, jan'17 this.moveWaitToRoad(now); this.getTransitQLink().handleTransitVehiclesInStopQueue(now); lanesActive = this.moveLanes(); } else { this.getTransitQLink().handleTransitVehiclesInStopQueue(now); lanesActive = this.moveLanes(); movedWaitToRoad = this.moveWaitToRoad(now); } this.setActive(lanesActive || movedWaitToRoad || (!this.getWaitingList().isEmpty()) || !this.getTransitQLink().getTransitVehicleStopQueue().isEmpty()); return this.isActive(); }
@Override public Collection<AgentSnapshotInfo> addAgentSnapshotInfo( final Collection<AgentSnapshotInfo> positions) { double now = context.getSimTimer().getTimeOfDay() ; if (visLink != null) { for (QLaneI ql : QLinkLanesImpl.this.laneQueues.values()) { VisLane otfLane = visLink.getLaneData().get( ql.getId().toString()); ((QueueWithBuffer.VisDataImpl) ql.getVisData()).setVisInfo( otfLane.getStartCoord(), otfLane.getEndCoord()); } } for (QLaneI road : QLinkLanesImpl.this.getQueueLanes().values()) { road.getVisData().addAgentSnapshotInfo(positions, now); } int cnt2 = 10; // treat vehicles from transit stops cnt2 = context.snapshotInfoBuilder.positionVehiclesFromTransitStop(positions, getLink(), getTransitQLink().getTransitVehicleStopQueue(), cnt2); // treat vehicles from waiting list: context.snapshotInfoBuilder.positionVehiclesFromWaitingList(positions, QLinkLanesImpl.this.getLink(), cnt2, QLinkLanesImpl.this.getWaitingList()); cnt2 = QLinkLanesImpl.this.getWaitingList().size(); context.snapshotInfoBuilder.positionAgentsInActivities(positions, QLinkLanesImpl.this.getLink(), QLinkLanesImpl.this.getAdditionalAgentsOnLink(), cnt2); return positions; } }
this.getLink().getId(), veh.getId(), veh.getDriver().getMode(), 1.0)); if (this.getTransitQLink().addTransitToStopQueue(now, veh, this.getLink().getId())) { continue;