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:
parent
67db18b6df
commit
44d0efdd54
3 changed files with 48 additions and 10 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue