@Override public final void initBeforeSimStep() { if(!context.qsimConfig.isUsingFastCapacityUpdate() ){ updateSlowFlowAccumulation(); } } private static int wrnCnt=0 ;
private final QVehicle removeFirstVehicle(){ double now = context.getSimTimer().getTimeOfDay() ; QVehicle veh = buffer.poll(); bufferLastMovedTime = now; // just in case there is another vehicle in the buffer that is now the new front-most if( context.qsimConfig.isUsingFastCapacityUpdate() ) { flowcap_accumulate.setTimeStep(now - 1); } return veh; }
@Override public final boolean isActive() { if( context.qsimConfig.isUsingFastCapacityUpdate() ){ return (!this.vehQueue.isEmpty()) || (!this.isNotOfferingVehicle() && context.qsimConfig.isUseLanes()) // if lanes, the buffer needs to be active in order to move vehicles over an internal node || ( !this.holes.isEmpty() ) ; } else { return (this.flowcap_accumulate.getValue() < flowCapacityPerTimeStep) // still accumulating, thus active || (!this.vehQueue.isEmpty()) // vehicles are on link, thus active || (!this.isNotOfferingVehicle() && context.qsimConfig.isUseLanes()) // if lanes, the buffer needs to be active in order to move vehicles over an internal node || ( !this.holes.isEmpty() ); // need to process arrival of holes } }
private boolean hasFlowCapacityLeft(VisVehicle veh) { if(context.qsimConfig.isUsingFastCapacityUpdate() ){ updateFastFlowAccumulation(); } return flowcap_accumulate.getValue() > 0.0 || veh.getVehicle().getType() .getPcuEquivalents() <= context.qsimConfig.getPcuThresholdForFlowCapacityEasing(); }
addEventHandlerBinding().to(SignalEvents2ViaCSVWriter.class); if (getConfig().qsim().isUsingFastCapacityUpdate()) { throw new RuntimeException("Fast flow capacity update does not support signals");
public MobsimListenerForTests(Scenario scenario, TravelTime travelTime) { this.travelTime = travelTime; this.isUsingFastCapacityUpdate = scenario.getConfig().qsim().isUsingFastCapacityUpdate(); Id<Link> id = Id.create("6", Link.class); link = scenario.getNetwork().getLinks().get(id); }