1
0
Fork 0
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:
oblonski 2014-01-14 18:01:15 -05:00
parent e4e556786b
commit 4dbf2e9388

View file

@ -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