Class ListVariableExhaustiveSearchDecider<Solution_,Score_ extends Score<Score_>>
java.lang.Object
ai.timefold.solver.core.impl.exhaustivesearch.decider.AbstractExhaustiveSearchDecider<Solution_,Score_>
ai.timefold.solver.core.impl.exhaustivesearch.decider.ListVariableExhaustiveSearchDecider<Solution_,Score_>
- All Implemented Interfaces:
ExhaustiveSearchPhaseLifecycleListener<Solution_>,SolverLifecycleListener<Solution_>,EventListener
public final class ListVariableExhaustiveSearchDecider<Solution_,Score_ extends Score<Score_>>
extends AbstractExhaustiveSearchDecider<Solution_,Score_>
-
Field Summary
Fields inherited from class ai.timefold.solver.core.impl.exhaustivesearch.decider.AbstractExhaustiveSearchDecider
acceptUninitializedSolutions, bestSolutionRecaller, manualEntityMimicRecorder, scoreBounderEnabled, sourceEntitySelector -
Constructor Summary
ConstructorsConstructorDescriptionListVariableExhaustiveSearchDecider(String logIndentation, BestSolutionRecaller<Solution_> bestSolutionRecaller, PhaseTermination<Solution_> termination, EntitySelector<Solution_> sourceEntitySelector, ManualEntityMimicRecorder<Solution_> manualEntityMimicRecorder, MoveRepository<Solution_> moveRepository, boolean scoreBounderEnabled, ScoreBounder<?> scoreBounder) -
Method Summary
Modifier and TypeMethodDescriptionvoidexpandNode(ExhaustiveSearchStepScope<Solution_> stepScope) The method updates the exploration of the solution's space when using a list variable.booleanisEntityReinitializable(Object entity) booleanisSolutionComplete(ExhaustiveSearchNode<Solution_> expandingNode) voidphaseEnded(ExhaustiveSearchPhaseScope<Solution_> phaseScope) voidphaseStarted(ExhaustiveSearchPhaseScope<Solution_> phaseScope) voidrestoreWorkingSolution(ExhaustiveSearchStepScope<Solution_> stepScope, boolean assertWorkingSolutionScoreFromScratch, boolean assertExpectedWorkingSolutionScore) Methods inherited from class ai.timefold.solver.core.impl.exhaustivesearch.decider.AbstractExhaustiveSearchDecider
doMove, enableAcceptUninitializedSolutions, expandNode, fillLayerList, getScoreBounder, initStartNode, setAssertExpectedUndoMoveScore, setAssertMoveScoreFromScratch, solvingEnded, solvingStarted, stepEnded, stepStartedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.impl.solver.event.SolverLifecycleListener
solvingError
-
Constructor Details
-
ListVariableExhaustiveSearchDecider
public ListVariableExhaustiveSearchDecider(String logIndentation, BestSolutionRecaller<Solution_> bestSolutionRecaller, PhaseTermination<Solution_> termination, EntitySelector<Solution_> sourceEntitySelector, ManualEntityMimicRecorder<Solution_> manualEntityMimicRecorder, MoveRepository<Solution_> moveRepository, boolean scoreBounderEnabled, ScoreBounder<?> scoreBounder)
-
-
Method Details
-
expandNode
The method updates the exploration of the solution's space when using a list variable. The logic will start adding all possible search nodes that belong to all available layers. For example, considering two entities[e0, e1]and the values[v0, v1], the result is:(layer 0, e0, [v0]), (layer 0, e0, [v1]), (layer 1, e1, [v0]), (layer 1, e1, [v1]). From these initial nodes, the method will be able to explore all possible solutions.When a solver adds another value to a list, the layer remains unchanged, ensuring that the depth remains equal. This allows the solver to correctly sort the nodes using either breadth-first or depth-first approaches. For example, the following search node has three values in the list
e0[v0, v1, v2], and its node tree is given as follows:(layer 0, e0, [v0]) | | (layer 0, e0, [v1]) | | (layer 0, e0, [v2])After selecting a search node, all potential moves for that node's layer and the subsequent layers are generated. This step is essential to prevent the reevaluation of already visited solutions. It's important to note that the previous layers have already evaluated all possible permutations.
- Specified by:
expandNodein classAbstractExhaustiveSearchDecider<Solution_,Score_ extends Score<Score_>>
-
isSolutionComplete
- Specified by:
isSolutionCompletein classAbstractExhaustiveSearchDecider<Solution_,Score_ extends Score<Score_>>
-
isEntityReinitializable
- Specified by:
isEntityReinitializablein classAbstractExhaustiveSearchDecider<Solution_,Score_ extends Score<Score_>>
-
restoreWorkingSolution
public void restoreWorkingSolution(ExhaustiveSearchStepScope<Solution_> stepScope, boolean assertWorkingSolutionScoreFromScratch, boolean assertExpectedWorkingSolutionScore) - Specified by:
restoreWorkingSolutionin classAbstractExhaustiveSearchDecider<Solution_,Score_ extends Score<Score_>>
-
phaseStarted
- Specified by:
phaseStartedin interfaceExhaustiveSearchPhaseLifecycleListener<Solution_>- Overrides:
phaseStartedin classAbstractExhaustiveSearchDecider<Solution_,Score_ extends Score<Score_>>
-
phaseEnded
- Specified by:
phaseEndedin interfaceExhaustiveSearchPhaseLifecycleListener<Solution_>- Overrides:
phaseEndedin classAbstractExhaustiveSearchDecider<Solution_,Score_ extends Score<Score_>>
-