Class AbstractTabuAcceptor<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.acceptor.AbstractAcceptor<Solution_>
org.optaplanner.core.impl.localsearch.decider.acceptor.tabu.AbstractTabuAcceptor<Solution_>
- All Implemented Interfaces:
EventListener,Acceptor<Solution_>,LocalSearchPhaseLifecycleListener<Solution_>,SolverLifecycleListener<Solution_>
- Direct Known Subclasses:
EntityTabuAcceptor,MoveTabuAcceptor,ValueTabuAcceptor
Abstract superclass for all Tabu Acceptors.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected TabuSizeStrategy<Solution_>protected final Stringprotected TabuSizeStrategy<Solution_>protected intprotected intFields inherited from class org.optaplanner.core.impl.localsearch.decider.acceptor.AbstractAcceptor
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadjustTabuList(int tabuStepIndex, Collection<? extends Object> tabus) protected doublecalculateFadingTabuAcceptChance(int fadingTabuStepCount) protected abstract Collection<? extends Object>findNewTabu(LocalSearchStepScope<Solution_> stepScope) protected abstract Collection<? extends Object>findTabu(LocalSearchMoveScope<Solution_> moveScope) booleanisAccepted(LocalSearchMoveScope<Solution_> moveScope) voidphaseEnded(LocalSearchPhaseScope<Solution_> phaseScope) voidphaseStarted(LocalSearchPhaseScope<Solution_> phaseScope) voidsetAspirationEnabled(boolean aspirationEnabled) voidsetAssertTabuHashCodeCorrectness(boolean assertTabuHashCodeCorrectness) voidsetFadingTabuSizeStrategy(TabuSizeStrategy<Solution_> fadingTabuSizeStrategy) voidsetTabuSizeStrategy(TabuSizeStrategy<Solution_> tabuSizeStrategy) voidstepEnded(LocalSearchStepScope<Solution_> stepScope) Methods inherited from class org.optaplanner.core.impl.localsearch.event.LocalSearchPhaseLifecycleListenerAdapter
stepStartedMethods inherited from class org.optaplanner.core.impl.solver.event.SolverLifecycleListenerAdapter
solvingEnded, solvingStartedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.optaplanner.core.impl.localsearch.event.LocalSearchPhaseLifecycleListener
stepStartedMethods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener
solvingEnded, solvingError, solvingStarted
-
Field Details
-
logIndentation
-
tabuSizeStrategy
-
fadingTabuSizeStrategy
-
aspirationEnabled
protected boolean aspirationEnabled -
assertTabuHashCodeCorrectness
protected boolean assertTabuHashCodeCorrectness -
tabuToStepIndexMap
-
tabuSequenceDeque
-
workingTabuSize
protected int workingTabuSize -
workingFadingTabuSize
protected int workingFadingTabuSize
-
-
Constructor Details
-
AbstractTabuAcceptor
-
-
Method Details
-
setTabuSizeStrategy
-
setFadingTabuSizeStrategy
-
setAspirationEnabled
public void setAspirationEnabled(boolean aspirationEnabled) -
setAssertTabuHashCodeCorrectness
public void setAssertTabuHashCodeCorrectness(boolean assertTabuHashCodeCorrectness) -
phaseStarted
- Specified by:
phaseStartedin interfaceLocalSearchPhaseLifecycleListener<Solution_>- Overrides:
phaseStartedin classLocalSearchPhaseLifecycleListenerAdapter<Solution_>
-
phaseEnded
- Specified by:
phaseEndedin interfaceLocalSearchPhaseLifecycleListener<Solution_>- Overrides:
phaseEndedin classLocalSearchPhaseLifecycleListenerAdapter<Solution_>
-
stepEnded
- Specified by:
stepEndedin interfaceLocalSearchPhaseLifecycleListener<Solution_>- Overrides:
stepEndedin classLocalSearchPhaseLifecycleListenerAdapter<Solution_>
-
adjustTabuList
-
isAccepted
- Parameters:
moveScope- not null- Returns:
- true if accepted
-
calculateFadingTabuAcceptChance
protected double calculateFadingTabuAcceptChance(int fadingTabuStepCount) - Parameters:
fadingTabuStepCount-0 < fadingTabuStepCount <= fadingTabuSize- Returns:
0.0 < acceptChance < 1.0
-
findTabu
-
findNewTabu
protected abstract Collection<? extends Object> findNewTabu(LocalSearchStepScope<Solution_> stepScope)
-