int uninitializedVariableCount = phaseScope.getSolutionDescriptor()
.countReinitializableVariables(scoreDirector, phaseScope.getWorkingSolution());
Collection<GenuineVariableDescriptor> genuineVariableDescriptors = entitySelector.getEntityDescriptor()
.getGenuineVariableDescriptors();
for (Object entity : entitySelector) {
ExhaustiveSearchLayer layer = new ExhaustiveSearchLayer(depth, entity, uninitializedVariableCount);
// Keep in sync with ExhaustiveSearchPhaseConfig.buildMoveSelectorConfig()
// which includes all genuineVariableDescriptors
int reinitializeVariableCount = entitySelector.getEntityDescriptor()
.countReinitializableVariables(scoreDirector, entity);
// Ignore entities with only initialized variables to avoid confusing bound decisions
if (reinitializeVariableCount == 0) {
continue;
}
depth++;
uninitializedVariableCount -= reinitializeVariableCount;
layerList.add(layer);
}
ExhaustiveSearchLayer lastLayer = new ExhaustiveSearchLayer(depth, null, uninitializedVariableCount);
layerList.add(lastLayer);
entitySelector.stepEnded(stepScope);
phaseScope.setLayerList(layerList);
}