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:
parent
1d34374510
commit
458b3cfc87
3 changed files with 15 additions and 18 deletions
|
|
@ -22,7 +22,7 @@
|
||||||
<algorithm xmlns="http://www.w3schools.com"
|
<algorithm xmlns="http://www.w3schools.com"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com algorithm_schema.xsd">
|
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>
|
<construction>
|
||||||
<insertion name="bestInsertion"/>
|
<insertion name="bestInsertion"/>
|
||||||
|
|
@ -31,31 +31,32 @@
|
||||||
<strategy>
|
<strategy>
|
||||||
<memory>1</memory>
|
<memory>1</memory>
|
||||||
<searchStrategies>
|
<searchStrategies>
|
||||||
<searchStrategy name="randomRuinAndRecreate">
|
<searchStrategy name="radialRuinAndRecreate">
|
||||||
<selector name="selectBest"/>
|
<selector name="selectBest"/>
|
||||||
<acceptor name="schrimpfAcceptance">
|
<acceptor name="schrimpfAcceptance">
|
||||||
<alpha>0.0</alpha>
|
<alpha>0.1</alpha>
|
||||||
<warmup>100</warmup>
|
<warmup>100</warmup>
|
||||||
</acceptor>
|
</acceptor>
|
||||||
<modules>
|
<modules>
|
||||||
<module name="ruin_and_recreate">
|
<module name="ruin_and_recreate">
|
||||||
<ruin name="randomRuin">
|
<ruin name="randomRuin">
|
||||||
<share>0.15</share>
|
<share>0.3</share>
|
||||||
</ruin>
|
</ruin>
|
||||||
<insertion name="bestInsertion"/>
|
<insertion name="bestInsertion"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
<probability>0.0</probability>
|
<probability>0.2</probability>
|
||||||
</searchStrategy>
|
</searchStrategy>
|
||||||
|
|
||||||
<searchStrategy name="radialRuinAndRecreate">
|
<searchStrategy name="radialRuinAndRecreate">
|
||||||
<selector name="selectBest"/>
|
<selector name="selectBest"/>
|
||||||
<acceptor name="schrimpfAcceptance"/>
|
<acceptor name="schrimpfAcceptance"/>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module name="ruin_and_recreate">
|
<module name="ruin_and_recreate">
|
||||||
<ruin name="radialRuin">
|
<ruin id="1" name="radialRuin">
|
||||||
<share>0.1</share>
|
<share>0.15</share>
|
||||||
</ruin>
|
</ruin>
|
||||||
<insertion name="bestInsertion"/>
|
<insertion name="bestInsertion"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
@ -69,14 +70,14 @@
|
||||||
<acceptor name="schrimpfAcceptance"/>
|
<acceptor name="schrimpfAcceptance"/>
|
||||||
<modules>
|
<modules>
|
||||||
<module name="ruin_and_recreate">
|
<module name="ruin_and_recreate">
|
||||||
<ruin name="radialRuin" id="1">
|
<ruin id="2" name="radialRuin">
|
||||||
<share>0.025</share>
|
<share>0.05</share>
|
||||||
</ruin>
|
</ruin>
|
||||||
<insertion name="bestInsertion"/>
|
<insertion name="bestInsertion"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
<probability>0.8</probability>
|
<probability>0.6</probability>
|
||||||
</searchStrategy>
|
</searchStrategy>
|
||||||
|
|
||||||
</searchStrategies>
|
</searchStrategies>
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,6 @@ public class MultipleDepotExample {
|
||||||
* solve the problem
|
* solve the problem
|
||||||
*/
|
*/
|
||||||
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig.xml");
|
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 StopWatch(),Priority.HIGH);
|
||||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
|
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
|
||||||
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
||||||
|
|
|
||||||
|
|
@ -106,8 +106,6 @@ public class MultipleDepotExampleWithPenaltyVehicles {
|
||||||
* solve the problem
|
* solve the problem
|
||||||
*/
|
*/
|
||||||
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig.xml");
|
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 StopWatch(),Priority.HIGH);
|
||||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
|
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
|
||||||
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue