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:
parent
67b4d57657
commit
e8d13ad7aa
1 changed files with 9 additions and 1 deletions
|
|
@ -97,6 +97,7 @@ public class Jsprit {
|
||||||
RUIN_WORST_NOISE_LEVEL("worst.noise_level"),
|
RUIN_WORST_NOISE_LEVEL("worst.noise_level"),
|
||||||
RUIN_WORST_NOISE_PROB("worst.noise_prob"),
|
RUIN_WORST_NOISE_PROB("worst.noise_prob"),
|
||||||
FAST_REGRET("regret.fast"),
|
FAST_REGRET("regret.fast"),
|
||||||
|
MAX_TRANSPORT_COSTS("max_transport_costs"),
|
||||||
CONSTRUCTION("construction");
|
CONSTRUCTION("construction");
|
||||||
|
|
||||||
String paraName;
|
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 jobNeighborhoods = new JobNeighborhoodsFactory().createNeighborhoods(vrp, new AvgServiceAndShipmentDistance(vrp.getTransportCosts()), (int) (vrp.getJobs().values().size() * 0.5));
|
||||||
jobNeighborhoods.initialise();
|
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;
|
IterationStartsListener noiseConfigurator;
|
||||||
if (noThreads > 1) {
|
if (noThreads > 1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue