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

modify example according to changes in VehicleTypeImpl

This commit is contained in:
oblonski 2013-06-21 11:35:57 +02:00
parent 1d34374510
commit 458b3cfc87
3 changed files with 15 additions and 18 deletions

View file

@ -22,7 +22,7 @@
<algorithm xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com algorithm_schema.xsd">
<iterations>2000</iterations>
<iterations>10000</iterations>
<construction>
<insertion name="bestInsertion"/>
@ -31,31 +31,32 @@
<strategy>
<memory>1</memory>
<searchStrategies>
<searchStrategy name="randomRuinAndRecreate">
<searchStrategy name="radialRuinAndRecreate">
<selector name="selectBest"/>
<acceptor name="schrimpfAcceptance">
<alpha>0.0</alpha>
<warmup>100</warmup>
<acceptor name="schrimpfAcceptance">
<alpha>0.1</alpha>
<warmup>100</warmup>
</acceptor>
<modules>
<module name="ruin_and_recreate">
<ruin name="randomRuin">
<share>0.15</share>
<share>0.3</share>
</ruin>
<insertion name="bestInsertion"/>
<insertion name="bestInsertion"/>
</module>
</modules>
<probability>0.0</probability>
<probability>0.2</probability>
</searchStrategy>
<searchStrategy name="radialRuinAndRecreate">
<selector name="selectBest"/>
<acceptor name="schrimpfAcceptance"/>
<acceptor name="schrimpfAcceptance"/>
<modules>
<module name="ruin_and_recreate">
<ruin name="radialRuin">
<share>0.1</share>
<ruin id="1" name="radialRuin">
<share>0.15</share>
</ruin>
<insertion name="bestInsertion"/>
</module>
@ -69,14 +70,14 @@
<acceptor name="schrimpfAcceptance"/>
<modules>
<module name="ruin_and_recreate">
<ruin name="radialRuin" id="1">
<share>0.025</share>
<ruin id="2" name="radialRuin">
<share>0.05</share>
</ruin>
<insertion name="bestInsertion"/>
</module>
</modules>
<probability>0.8</probability>
<probability>0.6</probability>
</searchStrategy>
</searchStrategies>

View file

@ -80,8 +80,6 @@ public class MultipleDepotExample {
* solve the problem
*/
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig.xml");
vra.setNuOfIterations(10000);
vra.setPrematureBreak(100);
vra.getAlgorithmListeners().addListener(new StopWatch(),Priority.HIGH);
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();

View file

@ -106,8 +106,6 @@ public class MultipleDepotExampleWithPenaltyVehicles {
* solve the problem
*/
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig.xml");
vra.setNuOfIterations(10000);
vra.setPrematureBreak(1000);
vra.getAlgorithmListeners().addListener(new StopWatch(),Priority.HIGH);
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();