return localSearchSolverPhase;
}
private Decider buildDecider(EnvironmentMode environmentMode, SolutionDescriptor solutionDescriptor,
ScoreDefinition scoreDefinition, Termination phaseTermination) {
DefaultDecider decider = new DefaultDecider();
decider.setTermination(phaseTermination);
MoveSelector moveSelector = buildMoveSelector(environmentMode, solutionDescriptor);
decider.setMoveSelector(moveSelector);
decider.setAcceptor(acceptorConfig.buildAcceptor(environmentMode, scoreDefinition));
Forager forager = foragerConfig.buildForager(scoreDefinition);
decider.setForager(forager);
if (moveSelector.isNeverEnding() && !forager.supportsNeverEndingMoveSelector()) {
throw new IllegalStateException("The moveSelector (" + moveSelector
+ ") has neverEnding (" + moveSelector.isNeverEnding()
+ "), but the forager (" + forager
+ ") does not support it."
+ " Configure the <forager> with <minimalAcceptedSelection>.");
}
if (environmentMode == EnvironmentMode.TRACE) {
decider.setAssertMoveScoreIsUncorrupted(true);
}
if (environmentMode == EnvironmentMode.DEBUG || environmentMode == EnvironmentMode.TRACE) {
decider.setAssertUndoMoveIsUncorrupted(true);
}
return decider;
}