private Map<Job, VehicleRoute> map(Collection<VehicleRoute> vehicleRoutes) { Map<Job, VehicleRoute> map = new HashMap<Job, VehicleRoute>(vrp.getJobs().size()); for (VehicleRoute r : vehicleRoutes) { for (Job j : r.getTourActivities().getJobs()) { map.put(j, r); } } return map; }
private void verifyThatRouteContainsAct(TourActivity activity, VehicleRoute route) { if (!route.getTourActivities().hasActivity(activity)) { throw new IllegalArgumentException( "specified route does not contain specified activity " + activity); } }