mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
Merge branch 'master' into driver-breaks
This commit is contained in:
commit
4925231e03
45 changed files with 152 additions and 175 deletions
|
|
@ -87,7 +87,7 @@ public class ConfigureAlgorithmInCodeInsteadOfPerXml {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
/*
|
||||
* get the best
|
||||
* get the best
|
||||
*/
|
||||
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public class EnRoutePickupAndDeliveryWithMultipleDepotsAndOpenRoutesExample {
|
|||
VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(problem, "input/algorithmConfig.xml");
|
||||
// algorithm.setMaxIterations(30000);
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class MultipleDepotExample {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
|
||||
/*
|
||||
* plot to see how the problem looks like
|
||||
* plot to see how the problem looks like
|
||||
*/
|
||||
// SolutionPlotter.plotVrpAsPNG(vrp, "output/problem01.png", "p01");
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public class MultipleDepotExample2 {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
|
||||
/*
|
||||
* plot to see how the problem looks like
|
||||
* plot to see how the problem looks like
|
||||
*/
|
||||
// SolutionPlotter.plotVrpAsPNG(vrp, "output/problem08.png", "p08");
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class MultipleDepotWithInitialRoutesExample {
|
|||
*/
|
||||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
/*
|
||||
* since job (service) 26 and 44 are already planned in initial route and thus static AND sequence is fixed they
|
||||
* since job (service) 26 and 44 are already planned in initial route and thus static AND sequence is fixed they
|
||||
* should not be in jobMap anymore (only variable jobs are in jobMap)
|
||||
*/
|
||||
assert !vrp.getJobs().containsKey("26") : "strange. service 26 should not be part of the problem";
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class PickupAndDeliveryExample {
|
|||
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml");
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class PickupAndDeliveryExample2 {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
||||
|
||||
/*
|
||||
* Retrieve best solution.
|
||||
* Retrieve best solution.
|
||||
*/
|
||||
VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class PickupAndDeliveryOpenExample {
|
|||
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_open.xml");
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public class RefuseCollectionExample {
|
|||
}
|
||||
String[] lineTokens = line.split(",");
|
||||
/*
|
||||
* build service
|
||||
* build service
|
||||
*/
|
||||
Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1])).setLocation(Location.newInstance(lineTokens[0])).build();
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class RefuseCollectionWithFastMatrixExample {
|
|||
}
|
||||
String[] lineTokens = line.split(",");
|
||||
/*
|
||||
* build service
|
||||
* build service
|
||||
*/
|
||||
Service service = Service.Builder.newInstance(lineTokens[0])
|
||||
.addSizeDimension(0, Integer.parseInt(lineTokens[1]))
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class ServicePickupsWithMultipleDepotsExample {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
/*
|
||||
* get the best
|
||||
* get the best
|
||||
*/
|
||||
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class SimpleDepotBoundedPickupAndDeliveryExample {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
/*
|
||||
* get the best
|
||||
* get the best
|
||||
*/
|
||||
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class SimpleEnRoutePickupAndDeliveryExample {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
/*
|
||||
* get the best
|
||||
* get the best
|
||||
*/
|
||||
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class SimpleEnRoutePickupAndDeliveryOpenRoutesExample {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
/*
|
||||
* get the best
|
||||
* get the best
|
||||
*/
|
||||
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public class SimpleEnRoutePickupAndDeliveryWithDepotBoundedDeliveriesExample {
|
|||
VehicleRoutingProblem problem = vrpBuilder.build();
|
||||
|
||||
/*
|
||||
* build the algorithm
|
||||
* build the algorithm
|
||||
*/
|
||||
VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(problem, "input/algorithmConfig.xml");
|
||||
vraBuilder.addCoreConstraints();
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class SimpleExample {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
/*
|
||||
* get the best
|
||||
* get the best
|
||||
*/
|
||||
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class SimpleExampleOpenRoutes {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
/*
|
||||
* get the best
|
||||
* get the best
|
||||
*/
|
||||
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public class SimpleExampleWithSkills {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
/*
|
||||
* get the best
|
||||
* get the best
|
||||
*/
|
||||
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public class SimpleVRPWithBackhaulsExample {
|
|||
SolutionPrinter.print(bestSolution);
|
||||
|
||||
/*
|
||||
* plot
|
||||
* plot
|
||||
*/
|
||||
Plotter plotter = new Plotter(problem, bestSolution);
|
||||
plotter.setLabel(Label.SIZE);
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class SolomonExample {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
||||
|
||||
/*
|
||||
* Retrieve best solution.
|
||||
* Retrieve best solution.
|
||||
*/
|
||||
VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class SolomonExampleWithSpecifiedVehicleEndLocations {
|
|||
// vra.setPrematureBreak(100);
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class SolomonExampleWithSpecifiedVehicleEndLocationsWithoutTWs {
|
|||
// vra.setPrematureBreak(100);
|
||||
// vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class SolomonOpenExample {
|
|||
// vra.setPrematureBreak(100);
|
||||
// vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class SolomonR101Example {
|
|||
vra.setMaxIterations(20000);
|
||||
// vra.setPrematureBreak(100);
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
/*
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class SolomonWithRegretInsertionExample {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
||||
|
||||
/*
|
||||
* Retrieve best solution.
|
||||
* Retrieve best solution.
|
||||
*/
|
||||
VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ public class TransportOfDisabledPeople {
|
|||
algorithm.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
|
||||
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class VRPWithBackhaulsExample {
|
|||
VehicleRoutingAlgorithm vra = vraBuilder.build();
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ public class VRPWithBackhaulsExample2 {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
|
||||
|
||||
/*
|
||||
* Retrieve best solution.
|
||||
* Retrieve best solution.
|
||||
*/
|
||||
VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue