Package org.optaplanner.core.impl.exhaustivesearch

## Class DefaultExhaustiveSearchPhase<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.phase.AbstractPhase<Solution_>
  - - org.optaplanner.core.impl.exhaustivesearch.DefaultExhaustiveSearchPhase<Solution_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` annotation
  All Implemented Interfaces:
    `EventListener`, `ExhaustiveSearchPhase<Solution_>`, `PhaseLifecycleListener<Solution_>`, `Phase<Solution_>`, `SolverLifecycleListener<Solution_>`

      public class DefaultExhaustiveSearchPhase<Solution_>
      extends AbstractPhase<Solution_>
      implements ExhaustiveSearchPhase<Solution_>

  Default implementation of `ExhaustiveSearchPhase`.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected boolean` | `assertExpectedWorkingSolutionScore` |
    `protected boolean` | `assertWorkingSolutionScoreFromScratch` |
    `protected ExhaustiveSearchDecider<Solution_>` | `decider` |
    `protected EntitySelector` | `entitySelector` |
    `protected Comparator<ExhaustiveSearchNode>` | `nodeComparator` |

    - ### Fields inherited from class org.optaplanner.core.impl.phase.AbstractPhase

      `assertExpectedStepScore, assertShadowVariablesAreNotStaleAfterStep, assertStepScoreFromScratch, bestSolutionRecaller, logger, logIndentation, phaseIndex, phaseLifecycleSupport, solverPhaseLifecycleSupport, termination`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultExhaustiveSearchPhase​(int phaseIndex, String logIndentation, BestSolutionRecaller<Solution_> bestSolutionRecaller, Termination termination)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ExhaustiveSearchDecider<Solution_>` | `getDecider()` |
    `EntitySelector` | `getEntitySelector()` |
    `Comparator<ExhaustiveSearchNode>` | `getNodeComparator()` |
    `String` | `getPhaseTypeString()` |
    `void` | `phaseEnded​(ExhaustiveSearchPhaseScope<Solution_> phaseScope)` |
    `void` | `phaseStarted​(ExhaustiveSearchPhaseScope<Solution_> phaseScope)` |
    `protected void` | `restoreWorkingSolution​(ExhaustiveSearchStepScope<Solution_> stepScope)` |
    `void` | `setAssertExpectedWorkingSolutionScore​(boolean assertExpectedWorkingSolutionScore)` |
    `void` | `setAssertWorkingSolutionScoreFromScratch​(boolean assertWorkingSolutionScoreFromScratch)` |
    `void` | `setDecider​(ExhaustiveSearchDecider<Solution_> decider)` |
    `void` | `setEntitySelector​(EntitySelector entitySelector)` |
    `void` | `setNodeComparator​(Comparator<ExhaustiveSearchNode> nodeComparator)` |
    `void` | `solve​(DefaultSolverScope<Solution_> solverScope)` |
    `void` | `solvingEnded​(DefaultSolverScope<Solution_> solverScope)` |
    `void` | `solvingStarted​(DefaultSolverScope<Solution_> solverScope)` |
    `void` | `stepEnded​(ExhaustiveSearchStepScope<Solution_> stepScope)` |
    `void` | `stepStarted​(ExhaustiveSearchStepScope<Solution_> stepScope)` |

    - ### Methods inherited from class org.optaplanner.core.impl.phase.AbstractPhase

      `addPhaseLifecycleListener, assertWorkingSolutionInitialized, calculateWorkingStepScore, getPhaseIndex, getTermination, isAssertExpectedStepScore, isAssertShadowVariablesAreNotStaleAfterStep, isAssertStepScoreFromScratch, phaseEnded, phaseStarted, predictWorkingStepScore, removePhaseLifecycleListener, setAssertExpectedStepScore, setAssertShadowVariablesAreNotStaleAfterStep, setAssertStepScoreFromScratch, setSolverPhaseLifecycleSupport, stepEnded, stepStarted`

    - ### 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.phase.Phase

      `addPhaseLifecycleListener, removePhaseLifecycleListener, setSolverPhaseLifecycleSupport`

    - ### Methods inherited from interface org.optaplanner.core.impl.phase.event.PhaseLifecycleListener

      `phaseEnded, phaseStarted, stepEnded, stepStarted`

- - ### Field Detail

    - #### nodeComparator

          protected Comparator<ExhaustiveSearchNode> nodeComparator

    - #### entitySelector

          protected EntitySelector entitySelector

    - #### decider

          protected ExhaustiveSearchDecider<Solution_> decider

    - #### assertWorkingSolutionScoreFromScratch

          protected boolean assertWorkingSolutionScoreFromScratch

    - #### assertExpectedWorkingSolutionScore

          protected boolean assertExpectedWorkingSolutionScore

  - ### Constructor Detail

    - #### DefaultExhaustiveSearchPhase

          public DefaultExhaustiveSearchPhase​(int phaseIndex,
                                              String logIndentation,
                                              BestSolutionRecaller<Solution_> bestSolutionRecaller,
                                              Termination termination)

  - ### Method Detail

    - #### getNodeComparator

          public Comparator<ExhaustiveSearchNode> getNodeComparator()

    - #### setNodeComparator

          public void setNodeComparator​(Comparator<ExhaustiveSearchNode> nodeComparator)

    - #### getEntitySelector

          public EntitySelector getEntitySelector()

    - #### setEntitySelector

          public void setEntitySelector​(EntitySelector entitySelector)

    - #### getDecider

          public ExhaustiveSearchDecider<Solution_> getDecider()

    - #### setDecider

          public void setDecider​(ExhaustiveSearchDecider<Solution_> decider)

    - #### setAssertWorkingSolutionScoreFromScratch

          public void setAssertWorkingSolutionScoreFromScratch​(boolean assertWorkingSolutionScoreFromScratch)

    - #### setAssertExpectedWorkingSolutionScore

          public void setAssertExpectedWorkingSolutionScore​(boolean assertExpectedWorkingSolutionScore)

    - #### getPhaseTypeString

          public String getPhaseTypeString()

      Specified by:
        `getPhaseTypeString` in class `AbstractPhase<Solution_>`

    - #### solve

          public void solve​(DefaultSolverScope<Solution_> solverScope)

      Specified by:
        `solve` in interface `Phase<Solution_>`

    - #### solvingStarted

          public void solvingStarted​(DefaultSolverScope<Solution_> solverScope)

      Specified by:
        `solvingStarted` in interface `SolverLifecycleListener<Solution_>`
      Overrides:
        `solvingStarted` in class `AbstractPhase<Solution_>`

    - #### phaseStarted

          public void phaseStarted​(ExhaustiveSearchPhaseScope<Solution_> phaseScope)

    - #### stepStarted

          public void stepStarted​(ExhaustiveSearchStepScope<Solution_> stepScope)

    - #### restoreWorkingSolution

          protected void restoreWorkingSolution​(ExhaustiveSearchStepScope<Solution_> stepScope)

    - #### stepEnded

          public void stepEnded​(ExhaustiveSearchStepScope<Solution_> stepScope)

    - #### phaseEnded

          public void phaseEnded​(ExhaustiveSearchPhaseScope<Solution_> phaseScope)

    - #### solvingEnded

          public void solvingEnded​(DefaultSolverScope<Solution_> solverScope)

      Specified by:
        `solvingEnded` in interface `SolverLifecycleListener<Solution_>`
      Overrides:
        `solvingEnded` in class `AbstractPhase<Solution_>`