@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 boolean doSimStep() { double now = context.getSimTimer().getTimeOfDay() ; qlane.initBeforeSimStep(); if ( context.qsimConfig.isInsertingWaitingVehiclesBeforeDrivingVehicles() ) { this.moveWaitToRoad(); this.getTransitQLink().handleTransitVehiclesInStopQueue(now); qlane.doSimStep(); } else { this.getTransitQLink().handleTransitVehiclesInStopQueue(now); qlane.doSimStep(); this.moveWaitToRoad(); } this.setActive(this.checkForActivity()); return isActive(); // yy seems to me that for symmetry there should be something like // netElementActivationRegistry.registerLinkAsActive(this); // and may be a qlink.deactivateLink(...) around it (analogous to qlink.activateLink). // That is, do NOT pass the deactivation of the link rather implicitly via returning a false here. // kai, mar'16 }