1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

make maxTransportCost a variable property

This commit is contained in:
oblonski 2015-10-23 17:12:52 +02:00
parent 67b4d57657
commit e8d13ad7aa

View file

@ -97,6 +97,7 @@ public class Jsprit {
RUIN_WORST_NOISE_LEVEL("worst.noise_level"),
RUIN_WORST_NOISE_PROB("worst.noise_prob"),
FAST_REGRET("regret.fast"),
MAX_TRANSPORT_COSTS("max_transport_costs"),
CONSTRUCTION("construction");
String paraName;
@ -336,7 +337,14 @@ public class Jsprit {
JobNeighborhoods jobNeighborhoods = new JobNeighborhoodsFactory().createNeighborhoods(vrp, new AvgServiceAndShipmentDistance(vrp.getTransportCosts()), (int) (vrp.getJobs().values().size() * 0.5));
jobNeighborhoods.initialise();
final double maxCosts = jobNeighborhoods.getMaxDistance();
final double maxCosts;
if(properties.containsKey(Parameter.MAX_TRANSPORT_COSTS.toString())){
maxCosts = Double.parseDouble(getProperty(Parameter.MAX_TRANSPORT_COSTS.toString()));
}
else{
maxCosts = jobNeighborhoods.getMaxDistance();
}
IterationStartsListener noiseConfigurator;
if (noThreads > 1) {