if (unimprovedTimeMillisSpentLimit != null) {
terminationList.add(new UnimprovedTimeMillisSpentTermination(unimprovedTimeMillisSpentLimit));
}
if (bestScoreLimit != null) {
Score bestScoreLimit_ = configPolicy.getScoreDefinition().parseScore(bestScoreLimit);
ScoreDefinition scoreDefinition = configPolicy.getScoreDefinition();
double[] timeGradientWeightNumbers = new double[scoreDefinition.getLevelsSize() - 1];
for (int i = 0; i < timeGradientWeightNumbers.length; i++) {
timeGradientWeightNumbers[i] = 0.50; // Number pulled out of thin air
}
terminationList.add(new BestScoreTermination(scoreDefinition, bestScoreLimit_, timeGradientWeightNumbers));
}
if (bestScoreFeasible != null) {
ScoreDefinition scoreDefinition = configPolicy.getScoreDefinition();
if (!(scoreDefinition instanceof FeasibilityScoreDefinition)) {
throw new IllegalStateException("The termination bestScoreFeasible (" + bestScoreFeasible
+ ") is not compatible with a scoreDefinitionClass (" + scoreDefinition.getClass()
+ ") which does not implement the interface "
+ FeasibilityScoreDefinition.class.getSimpleName() + ".");
}
if (!bestScoreFeasible) {
throw new IllegalArgumentException("The termination bestScoreFeasible (" + bestScoreFeasible