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

replace (incorrect) iFacts.getNewRouteDepTime() with prevActDepTime

This commit is contained in:
Michal Maciejewski 2018-11-10 12:38:39 +01:00
parent 3579dca52d
commit 3c1e8bc9d1
No known key found for this signature in database
GPG key ID: 015947E60A2AD77B

View file

@ -78,8 +78,8 @@ public class MaxDistanceConstraint implements HardActivityConstraint {
double maxDistance = getMaxDistance(iFacts.getNewVehicle());
if (currentDistance > maxDistance) return ConstraintsStatus.NOT_FULFILLED_BREAK;
double distancePrevAct2NewAct = distanceCalculator.getDistance(prevAct.getLocation(), newAct.getLocation(), iFacts.getNewDepTime(), iFacts.getNewVehicle());
double distanceNewAct2nextAct = distanceCalculator.getDistance(newAct.getLocation(), nextAct.getLocation(), iFacts.getNewDepTime(), iFacts.getNewVehicle());
double distancePrevAct2NewAct = distanceCalculator.getDistance(prevAct.getLocation(), newAct.getLocation(), prevActDepTime, iFacts.getNewVehicle());
double distanceNewAct2nextAct = distanceCalculator.getDistance(newAct.getLocation(), nextAct.getLocation(), prevActDepTime, iFacts.getNewVehicle());
double distancePrevAct2NextAct = distanceCalculator.getDistance(prevAct.getLocation(), nextAct.getLocation(), prevActDepTime, iFacts.getNewVehicle());
if (prevAct instanceof Start && nextAct instanceof End) distancePrevAct2NextAct = 0;
if (nextAct instanceof End && !iFacts.getNewVehicle().isReturnToDepot()) {