mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
improve penVehicle setting
This commit is contained in:
parent
e4e556786b
commit
4dbf2e9388
1 changed files with 2 additions and 2 deletions
|
|
@ -228,7 +228,7 @@ public class BicycleMessenger {
|
|||
problemBuilder.addConstraint(new ThreeTimesLessThanBestDirectRouteConstraint(nearestMessengers, routingCosts, stateManager));
|
||||
problemBuilder.addConstraint(new IgnoreMessengerThatCanNeverMeetTimeRequirements(nearestMessengers, routingCosts));
|
||||
|
||||
problemBuilder.addPenaltyVehicles(10.0);
|
||||
problemBuilder.addPenaltyVehicles(10.0,50000);
|
||||
|
||||
//finally build the problem
|
||||
VehicleRoutingProblem bicycleMessengerProblem = problemBuilder.build();
|
||||
|
|
@ -241,7 +241,7 @@ public class BicycleMessenger {
|
|||
//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.setNuOfIterations(200);
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
//this is just to ensure that solution meet the above constraints
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue