mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
clean up
This commit is contained in:
parent
579964fb72
commit
6691cf5ab1
1 changed files with 2 additions and 6 deletions
|
|
@ -51,7 +51,7 @@ public final class InsertionInitialSolutionFactory implements InitialSolutionFac
|
||||||
@Override
|
@Override
|
||||||
public VehicleRoutingProblemSolution createSolution(final VehicleRoutingProblem vrp) {
|
public VehicleRoutingProblemSolution createSolution(final VehicleRoutingProblem vrp) {
|
||||||
logger.info("create initial solution");
|
logger.info("create initial solution");
|
||||||
List<VehicleRoute> vehicleRoutes = new ArrayList<VehicleRoute>();
|
List<VehicleRoute> vehicleRoutes = new ArrayList<>();
|
||||||
vehicleRoutes.addAll(vrp.getInitialVehicleRoutes());
|
vehicleRoutes.addAll(vrp.getInitialVehicleRoutes());
|
||||||
Collection<Job> badJobs = insertion.insertJobs(vehicleRoutes, getUnassignedJobs(vrp));
|
Collection<Job> badJobs = insertion.insertJobs(vehicleRoutes, getUnassignedJobs(vrp));
|
||||||
VehicleRoutingProblemSolution solution = new VehicleRoutingProblemSolution(vehicleRoutes, badJobs, Double.MAX_VALUE);
|
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) {
|
private List<Job> getUnassignedJobs(VehicleRoutingProblem vrp) {
|
||||||
ArrayList<Job> jobs = new ArrayList<Job>(vrp.getJobs().values());
|
return new ArrayList<>(vrp.getJobs().values());
|
||||||
// for (Vehicle v : vrp.getVehicles()) {
|
|
||||||
// if (v.getBreak() != null) jobs.add(v.getBreak());
|
|
||||||
// }
|
|
||||||
return jobs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue