Class AcceptedLocalSearchForager<Solution_>
java.lang.Object
org.optaplanner.core.impl.solver.event.SolverLifecycleListenerAdapter<Solution_>
org.optaplanner.core.impl.localsearch.event.LocalSearchPhaseLifecycleListenerAdapter<Solution_>
org.optaplanner.core.impl.localsearch.decider.forager.AbstractLocalSearchForager<Solution_>
org.optaplanner.core.impl.localsearch.decider.forager.AcceptedLocalSearchForager<Solution_>
- All Implemented Interfaces:
EventListener
,LocalSearchForager<Solution_>
,LocalSearchPhaseLifecycleListener<Solution_>
,SolverLifecycleListener<Solution_>
A
LocalSearchForager
which forages accepted moves and ignores unaccepted moves.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final int
protected long
protected final boolean
protected LocalSearchMoveScope<Solution_>
protected final FinalistPodium<Solution_>
protected final LocalSearchPickEarlyType
protected long
Fields inherited from class org.optaplanner.core.impl.localsearch.decider.forager.AbstractLocalSearchForager
logger
-
Constructor Summary
ConstructorDescriptionAcceptedLocalSearchForager
(FinalistPodium<Solution_> finalistPodium, LocalSearchPickEarlyType pickEarlyType, int acceptedCountLimit, boolean breakTieRandomly) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMove
(LocalSearchMoveScope<Solution_> moveScope) protected void
checkPickEarly
(LocalSearchMoveScope<Solution_> moveScope) boolean
void
phaseEnded
(LocalSearchPhaseScope<Solution_> phaseScope) void
phaseStarted
(LocalSearchPhaseScope<Solution_> phaseScope) pickMove
(LocalSearchStepScope<Solution_> stepScope) void
solvingEnded
(SolverScope<Solution_> solverScope) void
solvingStarted
(SolverScope<Solution_> solverScope) void
stepEnded
(LocalSearchStepScope<Solution_> stepScope) void
stepStarted
(LocalSearchStepScope<Solution_> stepScope) boolean
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener
solvingError
-
Field Details
-
finalistPodium
-
pickEarlyType
-
acceptedCountLimit
protected final int acceptedCountLimit -
breakTieRandomly
protected final boolean breakTieRandomly -
selectedMoveCount
protected long selectedMoveCount -
acceptedMoveCount
protected long acceptedMoveCount -
earlyPickedMoveScope
-
-
Constructor Details
-
AcceptedLocalSearchForager
public AcceptedLocalSearchForager(FinalistPodium<Solution_> finalistPodium, LocalSearchPickEarlyType pickEarlyType, int acceptedCountLimit, boolean breakTieRandomly)
-
-
Method Details
-
solvingStarted
- Specified by:
solvingStarted
in interfaceSolverLifecycleListener<Solution_>
- Overrides:
solvingStarted
in classSolverLifecycleListenerAdapter<Solution_>
-
phaseStarted
- Specified by:
phaseStarted
in interfaceLocalSearchPhaseLifecycleListener<Solution_>
- Overrides:
phaseStarted
in classLocalSearchPhaseLifecycleListenerAdapter<Solution_>
-
stepStarted
- Specified by:
stepStarted
in interfaceLocalSearchPhaseLifecycleListener<Solution_>
- Overrides:
stepStarted
in classLocalSearchPhaseLifecycleListenerAdapter<Solution_>
-
supportsNeverEndingMoveSelector
public boolean supportsNeverEndingMoveSelector()- Returns:
- true if it can be combined with a
Selector.isNeverEnding()
that returns true.
-
addMove
- Parameters:
moveScope
- never null
-
checkPickEarly
-
isQuitEarly
public boolean isQuitEarly()- Returns:
- true if no further moves should be selected (and evaluated) for this step.
-
pickMove
- Parameters:
stepScope
- never null- Returns:
- sometimes null, for example if no move is selected
-
stepEnded
- Specified by:
stepEnded
in interfaceLocalSearchPhaseLifecycleListener<Solution_>
- Overrides:
stepEnded
in classLocalSearchPhaseLifecycleListenerAdapter<Solution_>
-
phaseEnded
- Specified by:
phaseEnded
in interfaceLocalSearchPhaseLifecycleListener<Solution_>
- Overrides:
phaseEnded
in classLocalSearchPhaseLifecycleListenerAdapter<Solution_>
-
solvingEnded
- Specified by:
solvingEnded
in interfaceSolverLifecycleListener<Solution_>
- Overrides:
solvingEnded
in classSolverLifecycleListenerAdapter<Solution_>
-
toString
-