? ExhaustiveSearchType.BRANCH_AND_BOUND : exhaustiveSearchType;
phaseConfigPolicy.setEntitySorterManner(entitySorterManner != null ? entitySorterManner
: exhaustiveSearchType_.getDefaultEntitySorterManner());
phaseConfigPolicy.setValueSorterManner(valueSorterManner != null ? valueSorterManner
: exhaustiveSearchType_.getDefaultValueSorterManner());
DefaultExhaustiveSearchPhase phase = new DefaultExhaustiveSearchPhase();
configurePhase(phase, phaseIndex, phaseConfigPolicy, bestSolutionRecaller, solverTermination);
boolean scoreBounderEnabled = exhaustiveSearchType_.isScoreBounderEnabled();
NodeExplorationType nodeExplorationType_;
if (exhaustiveSearchType_ == ExhaustiveSearchType.BRUTE_FORCE) {
nodeExplorationType_ = nodeExplorationType != null ? nodeExplorationType : NodeExplorationType.ORIGINAL_ORDER;
if (nodeExplorationType_ != NodeExplorationType.ORIGINAL_ORDER) {
throw new IllegalArgumentException("The phaseConfig (" + this
+ ") has an nodeExplorationType (" + nodeExplorationType
+ ") which is not compatible with its exhaustiveSearchType (" + exhaustiveSearchType
+ ").");
}
} else {
nodeExplorationType_ = nodeExplorationType != null ? nodeExplorationType : NodeExplorationType.DEPTH_FIRST;
}
phase.setNodeComparator(nodeExplorationType_.buildNodeComparator(scoreBounderEnabled));
EntitySelectorConfig entitySelectorConfig_ = buildEntitySelectorConfig(phaseConfigPolicy);
EntitySelector entitySelector = entitySelectorConfig_.buildEntitySelector(phaseConfigPolicy,
SelectionCacheType.PHASE, SelectionOrder.ORIGINAL);
phase.setEntitySelector(entitySelector);
phase.setDecider(buildDecider(phaseConfigPolicy, entitySelector, bestSolutionRecaller, phase.getTermination(),
scoreBounderEnabled));
EnvironmentMode environmentMode = phaseConfigPolicy.getEnvironmentMode();
if (environmentMode.isNonIntrusiveFullAsserted()) {
phase.setAssertWorkingSolutionScoreFromScratch(true);
}
if (environmentMode.isIntrusiveFastAsserted()) {
phase.setAssertExpectedWorkingSolutionScore(true);
}
return phase;
}