mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
extractToGetLatestArrival (#82)
This commit is contained in:
parent
261a587e5f
commit
eff17bc299
1 changed files with 6 additions and 2 deletions
|
|
@ -69,7 +69,7 @@ public class UpdateVehicleDependentPracticalTimeWindows implements RouteVisitor,
|
||||||
|
|
||||||
private VehicleRoute route;
|
private VehicleRoute route;
|
||||||
|
|
||||||
private double[] latest_arrTimes_at_prevAct;
|
protected double[] latest_arrTimes_at_prevAct;
|
||||||
|
|
||||||
private Location[] location_of_prevAct;
|
private Location[] location_of_prevAct;
|
||||||
|
|
||||||
|
|
@ -109,7 +109,7 @@ public class UpdateVehicleDependentPracticalTimeWindows implements RouteVisitor,
|
||||||
Location prevLocation = location_of_prevAct[vehicle.getVehicleTypeIdentifier().getIndex()];
|
Location prevLocation = location_of_prevAct[vehicle.getVehicleTypeIdentifier().getIndex()];
|
||||||
double potentialLatestArrivalTimeAtCurrAct = latestArrTimeAtPrevAct - transportCosts.getBackwardTransportTime(activity.getLocation(), prevLocation,
|
double potentialLatestArrivalTimeAtCurrAct = latestArrTimeAtPrevAct - transportCosts.getBackwardTransportTime(activity.getLocation(), prevLocation,
|
||||||
latestArrTimeAtPrevAct, route.getDriver(), vehicle) - activityCosts.getActivityDuration(prev, activity, latestArrTimeAtPrevAct, route.getDriver(), route.getVehicle());
|
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()) {
|
if (latestArrivalTime < activity.getTheoreticalEarliestOperationStartTime()) {
|
||||||
stateManager.putTypedInternalRouteState(route, vehicle, InternalStates.SWITCH_NOT_FEASIBLE, true);
|
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() {
|
public void finish() {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue