Package org.optaplanner.core.impl.score

## Class DefaultScoreManager<Solution_,​Score_ extends Score<Score_>>

- java.lang.Object
- - org.optaplanner.core.impl.score.DefaultScoreManager<Solution_,​Score_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` annotation
  All Implemented Interfaces:
    `ScoreManager<Solution_,​Score_>`

      public final class DefaultScoreManager<Solution_,​Score_ extends Score<Score_>>
      extends Object
      implements ScoreManager<Solution_,​Score_>

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultScoreManager​(InnerScoreDirectorFactory<Solution_,​Score_> scoreDirectorFactory)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ScoreExplanation<Solution_,​Score_>` | `explainScore​(Solution_ solution)` | Calculates and retrieves `ConstraintMatchTotal`s and `Indictment`s necessary for describing the quality of a particular solution.
    `InnerScoreDirectorFactory<Solution_,​Score_>` | `getScoreDirectorFactory()` |
    `String` | `getSummary​(Solution_ solution)` | Returns a diagnostic text that explains the solution through the `ConstraintMatch` API to identify which constraints or planning entities cause that score quality.
    `Score_` | `updateScore​(Solution_ solution)` | Calculates the `Score` of a `PlanningSolution` and updates its `PlanningScore` member.

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

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

- - ### Constructor Detail

    - #### DefaultScoreManager

          public DefaultScoreManager​(InnerScoreDirectorFactory<Solution_,​Score_> scoreDirectorFactory)

  - ### Method Detail

    - #### getScoreDirectorFactory

          public InnerScoreDirectorFactory<Solution_,​Score_> getScoreDirectorFactory()

    - #### updateScore

          public Score_ updateScore​(Solution_ solution)

      Description copied from interface: `ScoreManager`
      Calculates the `Score` of a `PlanningSolution` and updates its `PlanningScore` member.
      Specified by:
        `updateScore` in interface `ScoreManager<Solution_,​Score_ extends Score<Score_>>`
      Parameters:
        `solution` - never null

    - #### getSummary

          public String getSummary​(Solution_ solution)

      Description copied from interface: `ScoreManager`
      Returns a diagnostic text that explains the solution through the `ConstraintMatch` API to identify which constraints or planning entities cause that score quality. In case of an `infeasible` solution, this can help diagnose the cause of that.

      Do not parse this string. Instead, to provide this information in a UI or a service, use `ScoreManager.explainScore(Object)` to retrieve `ScoreExplanation.getConstraintMatchTotalMap()` and `ScoreExplanation.getIndictmentMap()` and convert those into a domain specific API.

      Specified by:
        `getSummary` in interface `ScoreManager<Solution_,​Score_ extends Score<Score_>>`
      Parameters:
        `solution` - never null
      Returns:
        null if `ScoreManager.updateScore(Object)` returns null with the same solution

    - #### explainScore

          public ScoreExplanation<Solution_,​Score_> explainScore​(Solution_ solution)

      Description copied from interface: `ScoreManager`
      Calculates and retrieves `ConstraintMatchTotal`s and `Indictment`s necessary for describing the quality of a particular solution.
      Specified by:
        `explainScore` in interface `ScoreManager<Solution_,​Score_ extends Score<Score_>>`
      Parameters:
        `solution` - never null
      Returns:
        never null