/** * Returns tour if tour-activity-sequence is empty, i.e. to activity on the tour yet. * * @return true if route is empty */ public boolean isEmpty() { return tourActivities.isEmpty(); }
/** * Builds the route. * * @return {@link VehicleRoute} * @throws IllegalArgumentException if there are still shipments that have been picked up though but not delivery. */ public VehicleRoute build() { if (!openShipments.isEmpty()) { throw new IllegalArgumentException("there are still shipments that have not been delivered yet."); } if (!vehicle.isReturnToDepot()) { if (!tourActivities.isEmpty()) { end.setLocation(tourActivities.getActivities().get(tourActivities.getActivities().size() - 1).getLocation()); } } return new VehicleRoute(this); }
/** * Returns tour if tour-activity-sequence is empty, i.e. to activity on the tour yet. * * @return true if route is empty */ public boolean isEmpty() { return tourActivities.isEmpty(); }
/** * Builds the route. * * @return {@link VehicleRoute} * @throws IllegalArgumentException if there are still shipments that have been picked up though but not delivery. */ public VehicleRoute build() { if (!openShipments.isEmpty()) { throw new IllegalArgumentException("there are still shipments that have not been delivered yet."); } if (!vehicle.isReturnToDepot()) { if (!tourActivities.isEmpty()) { end.setLocation(tourActivities.getActivities().get(tourActivities.getActivities().size() - 1).getLocation()); } } return new VehicleRoute(this); }