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:
Stefan Schroeder 2013-12-05 12:32:43 +01:00
parent 4d8f31fb64
commit 8ca6966d95

View file

@ -206,7 +206,7 @@ public class BicycleMessenger {
stateManager.addStateUpdater(new UpdateLatestActivityStartTimes(stateManager, routingCosts, nearestMessengers)); stateManager.addStateUpdater(new UpdateLatestActivityStartTimes(stateManager, routingCosts, nearestMessengers));
//create your algorithm //create your algorithm
VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(bicycleMessengerProblem,"input/algorithmConfig_open.xml", stateManager); VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(bicycleMessengerProblem,4,"input/algorithmConfig_open.xml", stateManager);
//if you want, terminate it after 1000 iterations with no change //if you want, terminate it after 1000 iterations with no change
algorithm.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(1000)); algorithm.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(1000));
// algorithm.addListener(new AlgorithmSearchProgressChartListener("output/progress.png")); // algorithm.addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
@ -216,7 +216,6 @@ public class BicycleMessenger {
//this is just to ensure that solution meet the above constraints //this is just to ensure that solution meet the above constraints
validateSolution(Solutions.bestOf(solutions), bicycleMessengerProblem, nearestMessengers); validateSolution(Solutions.bestOf(solutions), bicycleMessengerProblem, nearestMessengers);
SolutionPrinter.print(Solutions.bestOf(solutions));
SolutionPrinter.print(bicycleMessengerProblem, Solutions.bestOf(solutions), Print.VERBOSE); SolutionPrinter.print(bicycleMessengerProblem, Solutions.bestOf(solutions), Print.VERBOSE);
//you may want to plot the problem //you may want to plot the problem