1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00
This commit is contained in:
oblonski 2019-07-10 19:27:06 +02:00
parent 579964fb72
commit 6691cf5ab1
No known key found for this signature in database
GPG key ID: 179DE487285680D1

View file

@ -51,7 +51,7 @@ public final class InsertionInitialSolutionFactory implements InitialSolutionFac
@Override
public VehicleRoutingProblemSolution createSolution(final VehicleRoutingProblem vrp) {
logger.info("create initial solution");
List<VehicleRoute> vehicleRoutes = new ArrayList<VehicleRoute>();
List<VehicleRoute> vehicleRoutes = new ArrayList<>();
vehicleRoutes.addAll(vrp.getInitialVehicleRoutes());
Collection<Job> badJobs = insertion.insertJobs(vehicleRoutes, getUnassignedJobs(vrp));
VehicleRoutingProblemSolution solution = new VehicleRoutingProblemSolution(vehicleRoutes, badJobs, Double.MAX_VALUE);
@ -61,11 +61,7 @@ public final class InsertionInitialSolutionFactory implements InitialSolutionFac
}
private List<Job> getUnassignedJobs(VehicleRoutingProblem vrp) {
ArrayList<Job> jobs = new ArrayList<Job>(vrp.getJobs().values());
// for (Vehicle v : vrp.getVehicles()) {
// if (v.getBreak() != null) jobs.add(v.getBreak());
// }
return jobs;
return new ArrayList<>(vrp.getJobs().values());
}
}