Package org.optaplanner.core.impl.constructionheuristic.decider

## Class MultiThreadedConstructionHeuristicDecider<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider<Solution_>
  - - org.optaplanner.core.impl.constructionheuristic.decider.MultiThreadedConstructionHeuristicDecider<Solution_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` annotation

      public class MultiThreadedConstructionHeuristicDecider<Solution_>
      extends ConstructionHeuristicDecider<Solution_>

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected boolean` | `assertExpectedStepScore` |
    `protected boolean` | `assertShadowVariablesAreNotStaleAfterStep` |
    `protected boolean` | `assertStepScoreFromScratch` |
    `protected ExecutorService` | `executor` |
    `protected CyclicBarrier` | `moveThreadBarrier` |
    `protected int` | `moveThreadCount` |
    `protected List<MoveThreadRunner<Solution_>>` | `moveThreadRunnerList` |
    `protected BlockingQueue<MoveThreadOperation<Solution_>>` | `operationQueue` |
    `protected OrderByMoveIndexBlockingQueue<Solution_>` | `resultQueue` |
    `protected int` | `selectedMoveBufferSize` |
    `protected ThreadFactory` | `threadFactory` |

    - ### Fields inherited from class org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider

      `assertExpectedUndoMoveScore, assertMoveScoreFromScratch, forager, logger, logIndentation, termination`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MultiThreadedConstructionHeuristicDecider​(String logIndentation, Termination termination, ConstructionHeuristicForager forager, ThreadFactory threadFactory, int moveThreadCount, int selectedMoveBufferSize)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected ExecutorService` | `createThreadPoolExecutor()` |
    `void` | `decideNextStep​(ConstructionHeuristicStepScope<Solution_> stepScope, Placement<Solution_> placement)` |
    `void` | `phaseEnded​(ConstructionHeuristicPhaseScope<Solution_> phaseScope)` |
    `void` | `phaseStarted​(ConstructionHeuristicPhaseScope<Solution_> phaseScope)` |
    `void` | `setAssertExpectedStepScore​(boolean assertExpectedStepScore)` |
    `void` | `setAssertShadowVariablesAreNotStaleAfterStep​(boolean assertShadowVariablesAreNotStaleAfterStep)` |
    `void` | `setAssertStepScoreFromScratch​(boolean assertStepScoreFromScratch)` |

    - ### Methods inherited from class org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider

      `doMove, getForager, pickMove, setAssertExpectedUndoMoveScore, setAssertMoveScoreFromScratch, solvingEnded, solvingStarted, stepEnded, stepStarted`

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

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

- - ### Field Detail

    - #### threadFactory

          protected final ThreadFactory threadFactory

    - #### moveThreadCount

          protected final int moveThreadCount

    - #### selectedMoveBufferSize

          protected final int selectedMoveBufferSize

    - #### assertStepScoreFromScratch

          protected boolean assertStepScoreFromScratch

    - #### assertExpectedStepScore

          protected boolean assertExpectedStepScore

    - #### assertShadowVariablesAreNotStaleAfterStep

          protected boolean assertShadowVariablesAreNotStaleAfterStep

    - #### operationQueue

          protected BlockingQueue<MoveThreadOperation<Solution_>> operationQueue

    - #### resultQueue

          protected OrderByMoveIndexBlockingQueue<Solution_> resultQueue

    - #### moveThreadBarrier

          protected CyclicBarrier moveThreadBarrier

    - #### executor

          protected ExecutorService executor

    - #### moveThreadRunnerList

          protected List<MoveThreadRunner<Solution_>> moveThreadRunnerList

  - ### Constructor Detail

    - #### MultiThreadedConstructionHeuristicDecider

          public MultiThreadedConstructionHeuristicDecider​(String logIndentation,
                                                           Termination termination,
                                                           ConstructionHeuristicForager forager,
                                                           ThreadFactory threadFactory,
                                                           int moveThreadCount,
                                                           int selectedMoveBufferSize)

  - ### Method Detail

    - #### setAssertStepScoreFromScratch

          public void setAssertStepScoreFromScratch​(boolean assertStepScoreFromScratch)

    - #### setAssertExpectedStepScore

          public void setAssertExpectedStepScore​(boolean assertExpectedStepScore)

    - #### setAssertShadowVariablesAreNotStaleAfterStep

          public void setAssertShadowVariablesAreNotStaleAfterStep​(boolean assertShadowVariablesAreNotStaleAfterStep)

    - #### phaseStarted

          public void phaseStarted​(ConstructionHeuristicPhaseScope<Solution_> phaseScope)

      Overrides:
        `phaseStarted` in class `ConstructionHeuristicDecider<Solution_>`

    - #### phaseEnded

          public void phaseEnded​(ConstructionHeuristicPhaseScope<Solution_> phaseScope)

      Overrides:
        `phaseEnded` in class `ConstructionHeuristicDecider<Solution_>`

    - #### createThreadPoolExecutor

          protected ExecutorService createThreadPoolExecutor()

    - #### decideNextStep

          public void decideNextStep​(ConstructionHeuristicStepScope<Solution_> stepScope,
                                     Placement<Solution_> placement)

      Overrides:
        `decideNextStep` in class `ConstructionHeuristicDecider<Solution_>`