@Override public double calculateVehicleSpacing(double linkLength, double overallStorageCapacity, Collection<? extends VisVehicle> vehs) { double sum = 0. ; for ( VisVehicle veh : vehs ) { sum += veh.getSizeInEquivalents() ; } return linkLength / sum ; }
private List<Plan> getPersonsNOW() { List<Plan> actPersons = new ArrayList<>(); VisLink link = simulationView.getVisNetwork().getVisLinks().get(this.queryLinkId); Collection<? extends VisVehicle> vehs = link.getAllVehicles(); for( VisVehicle veh : vehs) { if ( veh.getDriver() instanceof PlanAgent ) { Plan plan = ((PlanAgent)veh.getDriver()).getCurrentPlan() ; actPersons.add( plan ); } } return actPersons; }
private boolean hasFlowCapacityLeft(VisVehicle veh) { if(context.qsimConfig.isUsingFastCapacityUpdate() ){ updateFastFlowAccumulation(); } return flowcap_accumulate.getValue() > 0.0 || veh.getVehicle().getType() .getPcuEquivalents() <= context.qsimConfig.getPcuThresholdForFlowCapacityEasing(); }
@Override public double calculateVehicleSpacing(double curvedLength, double overallStorageCapacity, Collection<? extends VisVehicle> vehs) { // the length of a vehicle in visualization double sum = 0. ; for ( VisVehicle veh : vehs ) { sum += veh.getSizeInEquivalents() ; } double vehLen = Math.min( curvedLength / overallStorageCapacity , // number of ``cells'' curvedLength / sum // the link may be more than ``full'' because of forward squeezing of stuck vehicles ); return vehLen; }