From 050de45d8e97ffdbe758a014cb9935894e2e0748 Mon Sep 17 00:00:00 2001 From: Stefan Schroeder <4sschroeder@gmail.com> Date: Fri, 10 Jan 2014 15:17:37 +0100 Subject: [PATCH] misc --- .../core/algorithm/acceptor/SchrimpfAcceptance.java | 7 +++++++ jsprit-examples/input/algorithmConfig_open.xml | 6 +++--- .../src/main/java/jsprit/examples/BicycleMessenger.java | 9 +++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/jsprit-core/src/main/java/jsprit/core/algorithm/acceptor/SchrimpfAcceptance.java b/jsprit-core/src/main/java/jsprit/core/algorithm/acceptor/SchrimpfAcceptance.java index c221a465..d456907e 100644 --- a/jsprit-core/src/main/java/jsprit/core/algorithm/acceptor/SchrimpfAcceptance.java +++ b/jsprit-core/src/main/java/jsprit/core/algorithm/acceptor/SchrimpfAcceptance.java @@ -99,6 +99,13 @@ public class SchrimpfAcceptance implements SolutionAcceptor, IterationStartsList } + /** + * @param initialThreshold the initialThreshold to set + */ + public void setInitialThreshold(double initialThreshold) { + this.initialThreshold = initialThreshold; + } + @Override public void informAlgorithmStarts(VehicleRoutingProblem problem, VehicleRoutingAlgorithm algorithm, Collection solutions) { reset(); diff --git a/jsprit-examples/input/algorithmConfig_open.xml b/jsprit-examples/input/algorithmConfig_open.xml index f3defc1b..25c78f00 100755 --- a/jsprit-examples/input/algorithmConfig_open.xml +++ b/jsprit-examples/input/algorithmConfig_open.xml @@ -22,11 +22,11 @@ - 10000 + 1000 - + false @@ -42,7 +42,7 @@ - 0.4 + 0.5 diff --git a/jsprit-examples/src/main/java/jsprit/examples/BicycleMessenger.java b/jsprit-examples/src/main/java/jsprit/examples/BicycleMessenger.java index b7181a9a..b0187eba 100644 --- a/jsprit-examples/src/main/java/jsprit/examples/BicycleMessenger.java +++ b/jsprit-examples/src/main/java/jsprit/examples/BicycleMessenger.java @@ -8,7 +8,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import jsprit.analysis.toolbox.AlgorithmSearchProgressChartListener; +import jsprit.analysis.toolbox.GraphStreamViewer; +import jsprit.analysis.toolbox.GraphStreamViewer.Label; import jsprit.analysis.toolbox.Plotter; import jsprit.analysis.toolbox.SolutionPrinter; import jsprit.analysis.toolbox.SolutionPrinter.Print; @@ -237,8 +238,8 @@ public class BicycleMessenger { 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(1000)); - algorithm.addListener(new AlgorithmSearchProgressChartListener("output/progress.png")); - algorithm.setNuOfIterations(1000); +// algorithm.addListener(new AlgorithmSearchProgressChartListener("output/progress.png")); + algorithm.setNuOfIterations(200); Collection solutions = algorithm.searchSolutions(); //this is just to ensure that solution meet the above constraints @@ -265,7 +266,7 @@ public class BicycleMessenger { // new GraphStreamViewer(bicycleMessengerProblem).labelWith(Label.ID).setRenderShipments(true).setRenderDelay(150).display(); // -// new GraphStreamViewer(bicycleMessengerProblem, Solutions.bestOf(solutions)).setGraphStreamFrameScalingFactor(1.5).setCameraView(12500, 55000, 0.25).labelWith(Label.ACTIVITY).setRenderShipments(true).setRenderDelay(150).display(); + new GraphStreamViewer(bicycleMessengerProblem, Solutions.bestOf(solutions)).setGraphStreamFrameScalingFactor(1.5).setCameraView(12500, 55000, 0.25).labelWith(Label.ACTIVITY).setRenderShipments(true).setRenderDelay(150).display(); }