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

add stateManager

This commit is contained in:
oblonski 2013-12-03 21:22:53 +01:00
parent 9489b5f716
commit 1563610bb0

View file

@ -12,6 +12,7 @@ import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
import jsprit.core.algorithm.state.StateManager;
import jsprit.core.algorithm.termination.IterationWithoutImprovementTermination;
import jsprit.core.problem.VehicleRoutingProblem;
import jsprit.core.problem.VehicleRoutingProblem.Builder;
@ -107,6 +108,8 @@ public class BicycleMessenger {
VehicleRoutingProblem bicycleMessengerProblem = problemBuilder.build();
StateManager stateManager = new StateManager(bicycleMessengerProblem);
VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(bicycleMessengerProblem,"input/algorithmConfig_open.xml");
algorithm.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(200));
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();