Package org.optaplanner.core.impl.score
Class DefaultScoreExplanation<Solution_,Score_ extends Score<Score_>> 
java.lang.Object
org.optaplanner.core.impl.score.DefaultScoreExplanation<Solution_,Score_> 
- All Implemented Interfaces:
- ScoreExplanation<Solution_,- Score_> 
public final class DefaultScoreExplanation<Solution_,Score_ extends Score<Score_>> 
extends Object
implements ScoreExplanation<Solution_,Score_> 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionexplainScore(Score_ workingScore, Collection<ConstraintMatchTotal<Score_>> constraintMatchTotalCollection, Collection<Indictment<Score_>> indictmentCollection) explainScore(Score_ workingScore, Collection<ConstraintMatchTotal<Score_>> constraintMatchTotalCollection, Collection<Indictment<Score_>> indictmentCollection, int indictmentLimit, int constraintMatchLimit) Explains the impact of each planning entity or problem fact on theScore.Explains theScoreofScoreExplanation.getScore()for all constraints.getScore()Return theScorebeing explained.Retrieve thePlanningSolutionthat the score being explained comes from.Returns a diagnostic text that explains the solution through theConstraintMatchAPI to identify which constraints or planning entities cause that score quality.toString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.optaplanner.core.api.score.ScoreExplanationgetJustificationList
- 
Constructor Details- 
DefaultScoreExplanation
 
- 
- 
Method Details- 
explainScorepublic static <Score_ extends Score<Score_>> String explainScore(Score_ workingScore, Collection<ConstraintMatchTotal<Score_>> constraintMatchTotalCollection, Collection<Indictment<Score_>> indictmentCollection) 
- 
explainScorepublic static <Score_ extends Score<Score_>> String explainScore(Score_ workingScore, Collection<ConstraintMatchTotal<Score_>> constraintMatchTotalCollection, Collection<Indictment<Score_>> indictmentCollection, int indictmentLimit, int constraintMatchLimit) 
- 
getSolutionDescription copied from interface:ScoreExplanationRetrieve thePlanningSolutionthat the score being explained comes from.- Specified by:
- getSolutionin interface- ScoreExplanation<Solution_,- Score_ extends Score<Score_>> 
- Returns:
- never null
 
- 
getScoreDescription copied from interface:ScoreExplanationReturn theScorebeing explained. If the specificScoretype used by thePlanningSolutionis required, callScoreExplanation.getSolution()and retrieve it from there.
- 
getConstraintMatchTotalMapDescription copied from interface:ScoreExplanationExplains theScoreofScoreExplanation.getScore()by splitting it up perConstraint.The sum of ConstraintMatchTotal.getScore()equalsScoreExplanation.getScore().- Specified by:
- getConstraintMatchTotalMapin interface- ScoreExplanation<Solution_,- Score_ extends Score<Score_>> 
- Returns:
- never null, the key is the constraintId(to create one, useConstraintMatchTotal.composeConstraintId(String, String)).
- See Also:
 
- 
getJustificationListDescription copied from interface:ScoreExplanationExplains theScoreofScoreExplanation.getScore()for all constraints. The return value of this method is determined by several factors:- 
 With Constraint Streams, the user has an option to provide a custom justification mapping,
 implementing ConstraintJustification. If provided, everyConstraintMatchof such constraint will be associated with this custom justification class. Every constraint not associated with a custom justification class will be associated withDefaultConstraintJustification.
- 
 With ConstraintMatchAwareIncrementalScoreCalculator, everyConstraintMatchwill be associated with the justification class that the user created it with.
- 
 With score DRL, every ConstraintMatchwill be associated withDefaultConstraintJustification.
 - Specified by:
- getJustificationListin interface- ScoreExplanation<Solution_,- Score_ extends Score<Score_>> 
- Returns:
- never null, all constraint matches
- See Also:
 
- 
 With Constraint Streams, the user has an option to provide a custom justification mapping,
 implementing 
- 
getIndictmentMapDescription copied from interface:ScoreExplanationExplains the impact of each planning entity or problem fact on theScore. AnIndictmentis basically the inverse of aConstraintMatchTotal: it is aScoretotal for any of theindicted objects.The sum of ConstraintMatchTotal.getScore()differs fromScoreExplanation.getScore()because eachConstraintMatch.getScore()is counted for each of theindicted objects.- Specified by:
- getIndictmentMapin interface- ScoreExplanation<Solution_,- Score_ extends Score<Score_>> 
- Returns:
- never null, the key is a problem factor aplanning entity
- See Also:
 
- 
getSummaryDescription copied from interface:ScoreExplanationReturns a diagnostic text that explains the solution through theConstraintMatchAPI to identify which constraints or planning entities cause that score quality.In case of an infeasiblesolution, this can help diagnose the cause of that.- Specified by:
- getSummaryin interface- ScoreExplanation<Solution_,- Score_ extends Score<Score_>> 
- Returns:
- never null
 
- 
toString
 
-