// ************************************************************************
public CustomPhase buildPhase(int phaseIndex, HeuristicConfigPolicy solverConfigPolicy,
BestSolutionRecaller bestSolutionRecaller, Termination solverTermination) {
HeuristicConfigPolicy phaseConfigPolicy = solverConfigPolicy.createPhaseConfigPolicy();
DefaultCustomPhase customPhase = new DefaultCustomPhase();
configurePhase(customPhase, phaseIndex, phaseConfigPolicy, bestSolutionRecaller, solverTermination);
if (ConfigUtils.isEmptyCollection(customPhaseCommandClassList)) {
throw new IllegalArgumentException(
"Configure at least 1 <customPhaseCommandClass> in the <customPhase> configuration.");
}
List<CustomPhaseCommand> customPhaseCommandList
= new ArrayList<CustomPhaseCommand>(customPhaseCommandClassList.size());
for (Class<? extends CustomPhaseCommand> customPhaseCommandClass : customPhaseCommandClassList) {
CustomPhaseCommand customPhaseCommand = ConfigUtils.newInstance(this,
"customPhaseCommandClass", customPhaseCommandClass);
customPhaseCommandList.add(customPhaseCommand);
}
customPhase.setCustomPhaseCommandList(customPhaseCommandList);
customPhase.setForceUpdateBestSolution(forceUpdateBestSolution == null ? false : forceUpdateBestSolution);
return customPhase;
}