1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

added vehicle dependent time-window updater

This commit is contained in:
oblonski 2014-07-17 17:22:11 +02:00
parent 453a69a76a
commit a3afd00614
2 changed files with 4 additions and 7 deletions

View file

@ -122,6 +122,8 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
private VehicleRoutingProblem vrp;
int getMaxIndexOfVehicleTypeIdentifiers(){ return nuVehicleTypeKeys; }
public StateId createStateId(String name){
if(createdStateIds.containsKey(name)) return createdStateIds.get(name);
if(stateIndexCounter>=activity_states[0].length){

View file

@ -36,13 +36,8 @@ public class UpdateVehicleDependentPracticalTimeWindows implements ReverseActivi
this.transportCosts = tpCosts;
this.fleetManager = fleetManager;
this.vehicleSwitchAllowed=isVehicleSwitchAllowed;
int maxVehicleTypeIndex = getMaxTypeIndex(fleetManager);
latest_arrTimes_at_prevAct = new double[maxVehicleTypeIndex];
location_of_prevAct = new String[maxVehicleTypeIndex];
}
private int getMaxTypeIndex(VehicleFleetManager fleetManager) {
return 0;
latest_arrTimes_at_prevAct = new double[stateManager.getMaxIndexOfVehicleTypeIdentifiers() + 1];
location_of_prevAct = new String[stateManager.getMaxIndexOfVehicleTypeIdentifiers() + 1];
}
@Override