Termination termination = ConfigUtils.newInstance(this, "terminationClass", terminationClass);
terminationList.add(termination);
}
Long maximumTimeMillisSpendTotal = calculateMaximumTimeMillisSpendTotal();
if (maximumTimeMillisSpendTotal != null) {
TimeMillisSpendTermination termination = new TimeMillisSpendTermination();
termination.setMaximumTimeMillisSpend(maximumTimeMillisSpendTotal);
terminationList.add(termination);
}
if (scoreAttained != null) {
ScoreAttainedTermination termination = new ScoreAttainedTermination();
termination.setScoreAttained(scoreDefinition.parseScore(scoreAttained));
terminationList.add(termination);
}
if (maximumStepCount != null) {
StepCountTermination termination = new StepCountTermination();
termination.setMaximumStepCount(maximumStepCount);
terminationList.add(termination);
}
if (maximumUnimprovedStepCount != null) {
UnimprovedStepCountTermination termination = new UnimprovedStepCountTermination();
termination.setMaximumUnimprovedStepCount(maximumUnimprovedStepCount);
terminationList.add(termination);
}
if (!CollectionUtils.isEmpty(terminationConfigList)) {
for (TerminationConfig terminationConfig : terminationConfigList) {
Termination termination = terminationConfig.buildTermination(scoreDefinition);