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

fix open route updater

This commit is contained in:
oblonski 2015-01-06 12:30:37 +01:00
parent 67db18b6df
commit 44d0efdd54
3 changed files with 48 additions and 10 deletions

View file

@ -34,7 +34,7 @@ public class UpdateEndLocationIfRouteIsOpen implements StateUpdater, RouteVisito
private void setRouteEndToLastActivity(VehicleRoute route) {
if(!route.getActivities().isEmpty()){
TourActivity lastAct = route.getActivities().get(route.getActivities().size()-1);
route.getEnd().setLocationId(lastAct.getLocation().getId());
route.getEnd().setLocation(lastAct.getLocation());
}
}

View file

@ -106,7 +106,7 @@ public class GreatCircleCosts extends AbstractForwardVehicleRoutingTransportCost
from = locations.getCoord(fromLocation.getId());
to = locations.getCoord(toLocation.getId());
}
if(from == null || to == null) throw new NullPointerException();
if(from == null || to == null) throw new NullPointerException("either from or to location is null");
return GreatCircleDistanceCalculator.calculateDistance(from, to, distanceUnit) * detour;
}