@Override public void finish() { double distance = distanceCalculator.getDistance(prevAct.getLocation(), route.getEnd().getLocation()); sum_distance += distance; stateManager.putRouteState(route, distance_id, sum_distance); }
@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 distance(TourActivity activity) { return distanceCalculator.getDistance(prevAct.getLocation(), activity.getLocation()); }