diff --git a/jsprit-examples/src/main/java/jsprit/examples/BicycleMessenger.java b/jsprit-examples/src/main/java/jsprit/examples/BicycleMessenger.java index 51c05383..7d733465 100644 --- a/jsprit-examples/src/main/java/jsprit/examples/BicycleMessenger.java +++ b/jsprit-examples/src/main/java/jsprit/examples/BicycleMessenger.java @@ -219,7 +219,7 @@ public class BicycleMessenger { //create your algorithm VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(bicycleMessengerProblem,"input/algorithmConfig_open.xml", stateManager); //if you want, terminate it after 1000 iterations with no change - algorithm.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100)); +// algorithm.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(1000)); algorithm.addListener(new AlgorithmSearchProgressChartListener("output/progress.png")); algorithm.setNuOfIterations(2000); Collection solutions = algorithm.searchSolutions(); @@ -227,7 +227,6 @@ public class BicycleMessenger { //this is just to ensure that solution meet the above constraints validateSolution(Solutions.bestOf(solutions), bicycleMessengerProblem, nearestMessengers); - SolutionPrinter.print(bicycleMessengerProblem, Solutions.bestOf(solutions), Print.VERBOSE); //you may want to plot the problem Plotter plotter = new Plotter(bicycleMessengerProblem); @@ -245,6 +244,8 @@ public class BicycleMessenger { //and write out your solution in xml new VrpXMLWriter(bicycleMessengerProblem, solutions).write("output/bicycleMessenger.xml"); + SolutionPrinter.print(bicycleMessengerProblem, Solutions.bestOf(solutions), Print.VERBOSE); + } diff --git a/jsprit-examples/src/main/java/jsprit/examples/SimpleExample.java b/jsprit-examples/src/main/java/jsprit/examples/SimpleExample.java index 64a0f2e3..699e4655 100644 --- a/jsprit-examples/src/main/java/jsprit/examples/SimpleExample.java +++ b/jsprit-examples/src/main/java/jsprit/examples/SimpleExample.java @@ -21,6 +21,7 @@ import java.util.Collection; import jsprit.analysis.toolbox.SolutionPlotter; import jsprit.analysis.toolbox.SolutionPrinter; +import jsprit.analysis.toolbox.SolutionPrinter.Print; import jsprit.core.algorithm.VehicleRoutingAlgorithm; import jsprit.core.algorithm.box.SchrimpfFactory; import jsprit.core.problem.VehicleRoutingProblem; @@ -97,7 +98,7 @@ public class SimpleExample { new VrpXMLWriter(problem, solutions).write("output/problem-with-solution.xml"); - SolutionPrinter.print(bestSolution); + SolutionPrinter.print(problem,bestSolution,Print.VERBOSE); /* * plot