Package org.optaplanner.core.impl.score
Class DefaultScoreManager<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.score.DefaultScoreManager<Solution_>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
- All Implemented Interfaces:
ScoreManager<Solution_>
public class DefaultScoreManager<Solution_> extends Object implements ScoreManager<Solution_>
-
-
Constructor Summary
Constructors Constructor Description DefaultScoreManager(ScoreDirectorFactory<Solution_> scoreDirectorFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
explainScore(Solution_ solution)
Returns a diagnostic text that explains the solution through theConstraintMatch
API to identify which constraints or planning entities cause that score quality.ScoreDirectorFactory<Solution_>
getScoreDirectorFactory()
Score
updateScore(Solution_ solution)
-
-
-
Constructor Detail
-
DefaultScoreManager
public DefaultScoreManager(ScoreDirectorFactory<Solution_> scoreDirectorFactory)
-
-
Method Detail
-
getScoreDirectorFactory
public ScoreDirectorFactory<Solution_> getScoreDirectorFactory()
-
updateScore
public Score updateScore(Solution_ solution)
Description copied from interface:ScoreManager
- Specified by:
updateScore
in interfaceScoreManager<Solution_>
- Parameters:
solution
- never null
-
explainScore
public String explainScore(Solution_ solution)
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
SolverFactory.getScoreDirectorFactory()
to retrieveScoreDirector.getConstraintMatchTotalMap()
andScoreDirector.getIndictmentMap()
and convert those into a domain specific API.This method is thread-safe.
- Specified by:
explainScore
in interfaceScoreManager<Solution_>
- Returns:
- null if
ScoreManager.updateScore(Object)
returns null with the same solution - See Also:
ScoreDirector.explainScore()
-
-