@Override public void visit(TourActivity activity) { double distance = distanceCalculator.getDistance(prevAct.getLocation(), activity.getLocation()); sum_distance += distance; stateManager.putActivityState(activity, distance_id, sum_distance); prevAct = activity; }
private double transportCost(TourActivity activity) { return transportCost.getTransportCost( prevAct.getLocation(), activity.getLocation(), prevActDeparture, route.getDriver(), route.getVehicle()); }
private double c(TourActivity from, TourActivity to, Vehicle vehicle) { return vrp.getTransportCosts() .getTransportCost( from.getLocation(), to.getLocation(), from.getEndTime(), DriverImpl.noDriver(), vehicle); }
@Override public void finish() { double distance = distanceCalculator.getDistance(prevAct.getLocation(), route.getEnd().getLocation()); sum_distance += distance; stateManager.putRouteState(route, distance_id, sum_distance); }
private double distance(TourActivity activity) { return distanceCalculator.getDistance(prevAct.getLocation(), activity.getLocation()); }