Package org.optaplanner.core.impl.localsearch.decider.acceptor.tabu

## 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`

      public abstract class AbstractTabuAcceptor<Solution_>
      extends AbstractAcceptor<Solution_>

  Abstract superclass for all Tabu Acceptors.
  See Also:
    `Acceptor`

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected boolean` | `aspirationEnabled` |
    `protected boolean` | `assertTabuHashCodeCorrectness` |
    `protected TabuSizeStrategy<Solution_>` | `fadingTabuSizeStrategy` |
    `protected String` | `logIndentation` |
    `protected Deque<Object>` | `tabuSequenceDeque` |
    `protected TabuSizeStrategy<Solution_>` | `tabuSizeStrategy` |
    `protected Map<Object,​Integer>` | `tabuToStepIndexMap` |
    `protected int` | `workingFadingTabuSize` |
    `protected int` | `workingTabuSize` |

    - ### Fields inherited from class org.optaplanner.core.impl.localsearch.decider.acceptor.AbstractAcceptor

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractTabuAcceptor​(String logIndentation)` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `adjustTabuList​(int tabuStepIndex, Collection<? extends Object> tabus)` |
    `protected double` | `calculateFadingTabuAcceptChance​(int fadingTabuStepCount)` |
    `protected abstract Collection<? extends Object>` | `findNewTabu​(LocalSearchStepScope<Solution_> stepScope)` |
    `protected abstract Collection<? extends Object>` | `findTabu​(LocalSearchMoveScope<Solution_> moveScope)` |
    `boolean` | `isAccepted​(LocalSearchMoveScope<Solution_> moveScope)` |
    `void` | `phaseEnded​(LocalSearchPhaseScope<Solution_> phaseScope)` |
    `void` | `phaseStarted​(LocalSearchPhaseScope<Solution_> phaseScope)` |
    `void` | `setAspirationEnabled​(boolean aspirationEnabled)` |
    `void` | `setAssertTabuHashCodeCorrectness​(boolean assertTabuHashCodeCorrectness)` |
    `void` | `setFadingTabuSizeStrategy​(TabuSizeStrategy<Solution_> fadingTabuSizeStrategy)` |
    `void` | `setTabuSizeStrategy​(TabuSizeStrategy<Solution_> tabuSizeStrategy)` |
    `void` | `stepEnded​(LocalSearchStepScope<Solution_> stepScope)` |

    - ### Methods inherited from class org.optaplanner.core.impl.localsearch.event.LocalSearchPhaseLifecycleListenerAdapter

      `stepStarted`

    - ### Methods inherited from class org.optaplanner.core.impl.solver.event.SolverLifecycleListenerAdapter

      `solvingEnded, solvingStarted`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.optaplanner.core.impl.localsearch.event.LocalSearchPhaseLifecycleListener

      `stepStarted`

    - ### Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener

      `solvingEnded, solvingStarted`

- - ### Field Detail

    - #### logIndentation

          protected final String logIndentation

    - #### tabuSizeStrategy

          protected TabuSizeStrategy<Solution_> tabuSizeStrategy

    - #### fadingTabuSizeStrategy

          protected TabuSizeStrategy<Solution_> fadingTabuSizeStrategy

    - #### aspirationEnabled

          protected boolean aspirationEnabled

    - #### assertTabuHashCodeCorrectness

          protected boolean assertTabuHashCodeCorrectness

    - #### tabuToStepIndexMap

          protected Map<Object,​Integer> tabuToStepIndexMap

    - #### tabuSequenceDeque

          protected Deque<Object> tabuSequenceDeque

    - #### workingTabuSize

          protected int workingTabuSize

    - #### workingFadingTabuSize

          protected int workingFadingTabuSize

  - ### Constructor Detail

    - #### AbstractTabuAcceptor

          public AbstractTabuAcceptor​(String logIndentation)

  - ### Method Detail

    - #### setTabuSizeStrategy

          public void setTabuSizeStrategy​(TabuSizeStrategy<Solution_> tabuSizeStrategy)

    - #### setFadingTabuSizeStrategy

          public void setFadingTabuSizeStrategy​(TabuSizeStrategy<Solution_> fadingTabuSizeStrategy)

    - #### setAspirationEnabled

          public void setAspirationEnabled​(boolean aspirationEnabled)

    - #### setAssertTabuHashCodeCorrectness

          public void setAssertTabuHashCodeCorrectness​(boolean assertTabuHashCodeCorrectness)

    - #### phaseStarted

          public void phaseStarted​(LocalSearchPhaseScope<Solution_> phaseScope)

      Specified by:
        `phaseStarted` in interface `LocalSearchPhaseLifecycleListener<Solution_>`
      Overrides:
        `phaseStarted` in class `LocalSearchPhaseLifecycleListenerAdapter<Solution_>`

    - #### phaseEnded

          public void phaseEnded​(LocalSearchPhaseScope<Solution_> phaseScope)

      Specified by:
        `phaseEnded` in interface `LocalSearchPhaseLifecycleListener<Solution_>`
      Overrides:
        `phaseEnded` in class `LocalSearchPhaseLifecycleListenerAdapter<Solution_>`

    - #### stepEnded

          public void stepEnded​(LocalSearchStepScope<Solution_> stepScope)

      Specified by:
        `stepEnded` in interface `LocalSearchPhaseLifecycleListener<Solution_>`
      Overrides:
        `stepEnded` in class `LocalSearchPhaseLifecycleListenerAdapter<Solution_>`

    - #### adjustTabuList

          protected void adjustTabuList​(int tabuStepIndex,
                                        Collection<? extends Object> tabus)

    - #### isAccepted

          public boolean isAccepted​(LocalSearchMoveScope<Solution_> moveScope)

      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

          protected abstract Collection<? extends Object> findTabu​(LocalSearchMoveScope<Solution_> moveScope)

    - #### findNewTabu

          protected abstract Collection<? extends Object> findNewTabu​(LocalSearchStepScope<Solution_> stepScope)