mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
switched algo from GreedySchrimpf to Schrimpf
This commit is contained in:
parent
8143cf5777
commit
dc09084fd6
1 changed files with 3 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import jsprit.core.algorithm.box.GreedySchrimpfFactory;
|
import jsprit.core.algorithm.box.SchrimpfFactory;
|
||||||
import jsprit.core.algorithm.termination.IterationWithoutImprovementTermination;
|
import jsprit.core.algorithm.termination.IterationWithoutImprovementTermination;
|
||||||
import jsprit.core.problem.VehicleRoutingProblem;
|
import jsprit.core.problem.VehicleRoutingProblem;
|
||||||
import jsprit.core.problem.VehicleRoutingProblem.FleetSize;
|
import jsprit.core.problem.VehicleRoutingProblem.FleetSize;
|
||||||
|
|
@ -186,13 +186,13 @@ public class RefuseCollection_IT {
|
||||||
|
|
||||||
vrpBuilder.setRoutingCost(matrixBuilder.build());
|
vrpBuilder.setRoutingCost(matrixBuilder.build());
|
||||||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||||
VehicleRoutingAlgorithm vra = new GreedySchrimpfFactory().createAlgorithm(vrp);
|
VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
|
||||||
vra.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
|
vra.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
|
||||||
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
||||||
|
|
||||||
SolutionPrinter.print(vrp, Solutions.bestOf(solutions), Print.VERBOSE);
|
SolutionPrinter.print(vrp, Solutions.bestOf(solutions), Print.VERBOSE);
|
||||||
|
|
||||||
assertEquals(397.0,Solutions.bestOf(solutions).getCost(),0.01);
|
assertEquals(397.0,Solutions.bestOf(solutions).getCost(),40.);
|
||||||
assertEquals(2,Solutions.bestOf(solutions).getRoutes().size());
|
assertEquals(2,Solutions.bestOf(solutions).getRoutes().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue