private void updateSlowFlowAccumulation(){ if (this.thisTimeStepGreen && this.flowcap_accumulate.getValue() < flowCapacityPerTimeStep && isNotOfferingVehicle() ){ double newFlowCap = Math.min(flowcap_accumulate.getValue() + flowCapacityPerTimeStep, flowCapacityPerTimeStep); flowcap_accumulate.setValue(newFlowCap); } }
@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 void updateFastFlowAccumulation(){ double now = context.getSimTimer().getTimeOfDay() ; if( this.flowcap_accumulate.getTimeStep() < now && this.flowcap_accumulate.getValue() < flowCapacityPerTimeStep && isNotOfferingVehicle() ){ double timeSteps = (now - flowcap_accumulate.getTimeStep()) / context.qsimConfig.getTimeStepSize(); double accumulateFlowCap = timeSteps * flowCapacityPerTimeStep; double newFlowCap = Math.min(flowcap_accumulate.getValue() + accumulateFlowCap, flowCapacityPerTimeStep); flowcap_accumulate.setValue(newFlowCap); flowcap_accumulate.setTimeStep( now ); } }