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

extractToGetLatestArrival (#82)

This commit is contained in:
kandelirina 2019-04-11 10:34:22 +03:00 committed by GitHub
parent 261a587e5f
commit eff17bc299
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,7 +69,7 @@ public class UpdateVehicleDependentPracticalTimeWindows implements RouteVisitor,
private VehicleRoute route;
private double[] latest_arrTimes_at_prevAct;
protected double[] latest_arrTimes_at_prevAct;
private Location[] location_of_prevAct;
@ -109,7 +109,7 @@ public class UpdateVehicleDependentPracticalTimeWindows implements RouteVisitor,
Location prevLocation = location_of_prevAct[vehicle.getVehicleTypeIdentifier().getIndex()];
double potentialLatestArrivalTimeAtCurrAct = latestArrTimeAtPrevAct - transportCosts.getBackwardTransportTime(activity.getLocation(), prevLocation,
latestArrTimeAtPrevAct, route.getDriver(), vehicle) - activityCosts.getActivityDuration(prev, activity, latestArrTimeAtPrevAct, route.getDriver(), route.getVehicle());
double latestArrivalTime = Math.min(activity.getTheoreticalLatestOperationStartTime(), potentialLatestArrivalTimeAtCurrAct);
double latestArrivalTime = getLatestArrival(activity, potentialLatestArrivalTimeAtCurrAct);
if (latestArrivalTime < activity.getTheoreticalEarliestOperationStartTime()) {
stateManager.putTypedInternalRouteState(route, vehicle, InternalStates.SWITCH_NOT_FEASIBLE, true);
}
@ -119,6 +119,10 @@ public class UpdateVehicleDependentPracticalTimeWindows implements RouteVisitor,
}
}
protected double getLatestArrival(TourActivity activity, double potentialLatestArrivalTimeAtCurrAct) {
return Math.min(activity.getTheoreticalLatestOperationStartTime(), potentialLatestArrivalTimeAtCurrAct);
}
public void finish() {
}