add option to set abs. initial threshold
@@ -112,6 +112,7 @@ public class Jsprit {
WORST_MAX_SHARE("worst.max_share"),
THRESHOLD_ALPHA("threshold.alpha"),
THRESHOLD_INI("threshold.ini"),
+ THRESHOLD_INI_ABS("threshold.ini_abs"),
INSERTION_NOISE_LEVEL("insertion.noise_level"),
INSERTION_NOISE_PROB("insertion.noise_prob"),
RUIN_WORST_NOISE_LEVEL("worst.noise_level"),
@@ -602,6 +603,9 @@ public class Jsprit {
IterationStartsListener schrimpfThreshold = null;
if(acceptor == null) {
final SchrimpfAcceptance schrimpfAcceptance = new SchrimpfAcceptance(1, toDouble(getProperty(Parameter.THRESHOLD_ALPHA.toString())));
+ if (properties.containsKey(Parameter.THRESHOLD_INI_ABS.toString())) {
+ schrimpfAcceptance.setInitialThreshold(Double.valueOf(properties.getProperty(Parameter.THRESHOLD_INI_ABS.toString())));
+ } else {
schrimpfThreshold = new IterationStartsListener() {
@Override
public void informIterationStarts(int i, VehicleRoutingProblem problem, Collection<VehicleRoutingProblemSolution> solutions) {
@@ -611,6 +615,7 @@ public class Jsprit {
}
}
};
+ }
acceptor = schrimpfAcceptance;
}
