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 thePlanningSolution
annotation
- All Implemented Interfaces:
ScoreManager<Solution_,
Score_>
public final class DefaultScoreManager<Solution_,Score_ extends Score<Score_>>
extends Object
implements ScoreManager<Solution_,Score_>
-
Constructor Summary
ConstructorDescriptionDefaultScoreManager
(SolverFactory<Solution_> solverFactory) DefaultScoreManager
(SolverManager<Solution_, ProblemId_> solverManager) -
Method Summary
Modifier and TypeMethodDescriptionexplainScore
(Solution_ solution) Calculates and retrievesConstraintMatchTotal
s andIndictment
s necessary for describing the quality of a particular solution.getSummary
(Solution_ solution) Returns a diagnostic text that explains the solution through theConstraintMatch
API to identify which constraints or planning entities cause that score quality.updateScore
(Solution_ solution)
-
Constructor Details
-
DefaultScoreManager
-
DefaultScoreManager
-
-
Method Details
-
getScoreDirectorFactory
-
updateScore
Description copied from interface:ScoreManager
- Specified by:
updateScore
in interfaceScoreManager<Solution_,
Score_ extends Score<Score_>> - Parameters:
solution
- never null
-
getSummary
Description copied from interface:ScoreManager
Returns a diagnostic text that explains the solution through theConstraintMatch
API to identify which constraints or planning entities cause that score quality. In case of aninfeasible
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 retrieveScoreExplanation.getConstraintMatchTotalMap()
andScoreExplanation.getIndictmentMap()
and convert those into a domain specific API.- Specified by:
getSummary
in interfaceScoreManager<Solution_,
Score_ extends Score<Score_>> - Parameters:
solution
- never null- Returns:
- null if
ScoreManager.updateScore(Object)
returns null with the same solution
-
explainScore
Description copied from interface:ScoreManager
Calculates and retrievesConstraintMatchTotal
s andIndictment
s necessary for describing the quality of a particular solution.- Specified by:
explainScore
in interfaceScoreManager<Solution_,
Score_ extends Score<Score_>> - Parameters:
solution
- never null- Returns:
- never null
-