Termination phaseTermination, PlanningEntityDescriptor entityDescriptor) {
ValueSelector valueSelector = valueSelectorConfig.buildValueSelector(environmentMode,
solutionDescriptor, entityDescriptor,
selectedCountLimit == null ? SelectionCacheType.STEP : SelectionCacheType.JUST_IN_TIME,
selectedCountLimit == null ? SelectionOrder.ORIGINAL : SelectionOrder.RANDOM);
ValuePlacer valuePlacer = new ValuePlacer(phaseTermination, valueSelector,
selectedCountLimit == null ? Integer.MAX_VALUE : selectedCountLimit);
if (environmentMode == EnvironmentMode.TRACE) {
valuePlacer.setAssertMoveScoreIsUncorrupted(true);
}
if (environmentMode == EnvironmentMode.DEBUG || environmentMode == EnvironmentMode.TRACE) {
valuePlacer.setAssertUndoMoveIsUncorrupted(true);
}
return valuePlacer;
}