1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

consider initial routes when calculating initial solution

This commit is contained in:
oblonski 2014-04-21 17:11:20 +02:00
parent b8ef9a55a1
commit bd5adcd0f1

View file

@ -52,6 +52,7 @@ public final class InsertionInitialSolutionFactory implements InitialSolutionFac
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<VehicleRoute>();
vehicleRoutes.addAll(vrp.getInitialVehicleRoutes());
insertion.insertJobs(vehicleRoutes, getUnassignedJobs(vrp)); insertion.insertJobs(vehicleRoutes, getUnassignedJobs(vrp));
VehicleRoutingProblemSolution solution = new VehicleRoutingProblemSolution(vehicleRoutes, Double.MAX_VALUE); VehicleRoutingProblemSolution solution = new VehicleRoutingProblemSolution(vehicleRoutes, Double.MAX_VALUE);
double costs = solutionCostsCalculator.getCosts(solution); double costs = solutionCostsCalculator.getCosts(solution);