if noise prob is zero, omit noise stuff
@@ -443,12 +443,12 @@ public class Jsprit {
final double maxCosts;
if (properties.containsKey(Parameter.MAX_TRANSPORT_COSTS.toString())) {
maxCosts = Double.parseDouble(getProperty(Parameter.MAX_TRANSPORT_COSTS.toString()));
- }
- else{
+ } else {
maxCosts = jobNeighborhoods.getMaxDistance();
}
- IterationStartsListener noiseConfigurator;
+ IterationStartsListener noiseConfigurator = null;
+ if (noiseProbability > 0) {
if (noThreads > 1) {
ConcurrentInsertionNoiseMaker noiseMaker = new ConcurrentInsertionNoiseMaker(vrp, maxCosts, noiseLevel, noiseProbability);
noiseMaker.setRandom(random);
@@ -460,6 +460,7 @@ public class Jsprit {
constraintManager.addConstraint(noiseMaker);
noiseConfigurator = noiseMaker;
}
+ }
RuinRadial radial = new RuinRadial(vrp, vrp.getJobs().size(), jobNeighborhoods);
radial.setRandom(random);
@@ -676,7 +677,7 @@ public class Jsprit {
if (schrimpfThreshold != null) {
vra.addListener(schrimpfThreshold);
}
- vra.addListener(noiseConfigurator);
+ if (noiseConfigurator != null) vra.addListener(noiseConfigurator);
vra.addListener(noise);
vra.addListener(clusters);
if (increasingAbsoluteFixedCosts != null) vra.addListener(increasingAbsoluteFixedCosts);
