Class AbstractScoreHolder<Score_ extends Score<Score_>>
- java.lang.Object
-
- org.optaplanner.core.api.score.holder.AbstractScoreHolder<Score_>
-
- Type Parameters:
Score_- theScoretype
- All Implemented Interfaces:
Serializable,ScoreHolder<Score_>
- Direct Known Subclasses:
BendableBigDecimalScoreHolder,BendableLongScoreHolder,BendableScoreHolder,HardMediumSoftBigDecimalScoreHolder,HardMediumSoftLongScoreHolder,HardMediumSoftScoreHolder,HardSoftBigDecimalScoreHolder,HardSoftDoubleScoreHolder,HardSoftLongScoreHolder,HardSoftScoreHolder,SimpleBigDecimalScoreHolder,SimpleDoubleScoreHolder,SimpleLongScoreHolder,SimpleScoreHolder
@Deprecated public abstract class AbstractScoreHolder<Score_ extends Score<Score_>> extends Object implements ScoreHolder<Score_>, Serializable
Deprecated.for removal from public APIAbstract superclass forScoreHolder.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractScoreHolder.ConstraintActivationUnMatchListenerDeprecated.for removal from public API
-
Field Summary
Fields Modifier and Type Field Description protected booleanconstraintMatchEnabledDeprecated.protected Map<String,ConstraintMatchTotal>constraintMatchTotalMapDeprecated.protected Map<Object,Indictment>indictmentMapDeprecated.protected Score_zeroScoreDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractScoreHolder(boolean constraintMatchEnabled, Score_ zeroScore)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidconfigureConstraintWeight(org.kie.api.definition.rule.Rule rule, Score_ constraintWeight)Deprecated.Sets up aConstraintWeightfrom theConstraintConfigurationduring initialization.protected List<Object>extractJustificationList(org.kie.api.runtime.rule.RuleContext kcontext)Deprecated.Map<String,ConstraintMatchTotal>getConstraintMatchTotalMap()Deprecated.Explains theScoreofScoreHolder.extractScore(int).Collection<ConstraintMatchTotal>getConstraintMatchTotals()Deprecated.Explains theScoreofScoreHolder.extractScore(int).Map<Object,Indictment>getIndictmentMap()Deprecated.Explains the impact of each planning entity or problem fact on theScore.voidimpactScore(org.kie.api.runtime.rule.RuleContext kcontext)Deprecated.For internal use only, use penalize() or reward() instead.voidimpactScore(org.kie.api.runtime.rule.RuleContext kcontext, int weightMultiplier)Deprecated.For internal use only, use penalize() or reward() instead.voidimpactScore(org.kie.api.runtime.rule.RuleContext kcontext, long weightMultiplier)Deprecated.For internal use only, use penalize() or reward() instead.voidimpactScore(org.kie.api.runtime.rule.RuleContext kcontext, BigDecimal weightMultiplier)Deprecated.For internal use only, use penalize() or reward() instead.booleanisConstraintMatchEnabled()Deprecated.Must be in sync withScoreDirector.isConstraintMatchEnabled()for theScoreDirectorwhich contains thisScoreHolder.protected voidregisterConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, Runnable constraintUndoListener, Supplier<Score_> scoreSupplier)Deprecated.Requires @OptaPlannerRuleEventListenerto be added as event listener onKieSession, otherwise the score changes caused by the constraint matches would not be undone.voidsetJustificationListConverter(BiFunction<List<Object>,org.kie.api.definition.rule.Rule,List<Object>> converter)Deprecated.for removal from public API-
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.api.score.holder.ScoreHolder
extractScore
-
-
-
-
Field Detail
-
constraintMatchEnabled
protected final boolean constraintMatchEnabled
Deprecated.
-
constraintMatchTotalMap
protected final Map<String,ConstraintMatchTotal> constraintMatchTotalMap
Deprecated.
-
indictmentMap
protected final Map<Object,Indictment> indictmentMap
Deprecated.
-
-
Constructor Detail
-
AbstractScoreHolder
protected AbstractScoreHolder(boolean constraintMatchEnabled, Score_ zeroScore)Deprecated.
-
-
Method Detail
-
isConstraintMatchEnabled
public boolean isConstraintMatchEnabled()
Deprecated.Description copied from interface:ScoreHolderMust be in sync withScoreDirector.isConstraintMatchEnabled()for theScoreDirectorwhich contains thisScoreHolder.Defaults to true.
- Specified by:
isConstraintMatchEnabledin interfaceScoreHolder<Score_ extends Score<Score_>>- Returns:
- false if the
ConstraintMatchs andConstraintMatchTotals do not need to be collected which is a performance boost - See Also:
ScoreHolder.getConstraintMatchTotals()
-
getConstraintMatchTotals
public Collection<ConstraintMatchTotal> getConstraintMatchTotals()
Deprecated.Description copied from interface:ScoreHolderExplains theScoreofScoreHolder.extractScore(int).Should not be called directly, use
ScoreDirector.getConstraintMatchTotals()instead.- Specified by:
getConstraintMatchTotalsin interfaceScoreHolder<Score_ extends Score<Score_>>- Returns:
- never null
- See Also:
ScoreDirector.getConstraintMatchTotals()
-
getConstraintMatchTotalMap
public Map<String,ConstraintMatchTotal> getConstraintMatchTotalMap()
Deprecated.Description copied from interface:ScoreHolderExplains theScoreofScoreHolder.extractScore(int).Should not be called directly, use
ScoreDirector.getConstraintMatchTotalMap()instead.- Specified by:
getConstraintMatchTotalMapin interfaceScoreHolder<Score_ extends Score<Score_>>- Returns:
- never null
- See Also:
ScoreDirector.getConstraintMatchTotalMap()
-
getIndictmentMap
public Map<Object,Indictment> getIndictmentMap()
Deprecated.Description copied from interface:ScoreHolderExplains the impact of each planning entity or problem fact on theScore.Should not be called directly, use
ScoreDirector.getIndictmentMap()instead.- Specified by:
getIndictmentMapin interfaceScoreHolder<Score_ extends Score<Score_>>- Returns:
- never null
- See Also:
ScoreDirector.getIndictmentMap()
-
configureConstraintWeight
public void configureConstraintWeight(org.kie.api.definition.rule.Rule rule, Score_ constraintWeight)Deprecated.Description copied from interface:ScoreHolderSets up aConstraintWeightfrom theConstraintConfigurationduring initialization.- Specified by:
configureConstraintWeightin interfaceScoreHolder<Score_ extends Score<Score_>>- Parameters:
rule- never nullconstraintWeight- never null, withScore.getInitScore()equal to 0.
-
registerConstraintMatch
protected void registerConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, Runnable constraintUndoListener, Supplier<Score_> scoreSupplier)Deprecated.Requires @OptaPlannerRuleEventListenerto be added as event listener onKieSession, otherwise the score changes caused by the constraint matches would not be undone. SeeDroolsScoreDirector.resetKieSession()for an example.- Parameters:
kcontext- The rule for which to register the match.constraintUndoListener- The operation to run to undo the match.scoreSupplier- The score change to be undone when constraint justification enabled.
-
impactScore
public void impactScore(org.kie.api.runtime.rule.RuleContext kcontext)
Deprecated.For internal use only, use penalize() or reward() instead.- Parameters:
kcontext- never null
-
impactScore
public void impactScore(org.kie.api.runtime.rule.RuleContext kcontext, int weightMultiplier)Deprecated.For internal use only, use penalize() or reward() instead.- Parameters:
kcontext- never nullweightMultiplier- any
-
impactScore
public void impactScore(org.kie.api.runtime.rule.RuleContext kcontext, long weightMultiplier)Deprecated.For internal use only, use penalize() or reward() instead.- Parameters:
kcontext- never nullweightMultiplier- any
-
impactScore
public void impactScore(org.kie.api.runtime.rule.RuleContext kcontext, BigDecimal weightMultiplier)Deprecated.For internal use only, use penalize() or reward() instead.- Parameters:
kcontext- never nullweightMultiplier- any
-
extractJustificationList
protected List<Object> extractJustificationList(org.kie.api.runtime.rule.RuleContext kcontext)
Deprecated.
-
setJustificationListConverter
@Deprecated public void setJustificationListConverter(BiFunction<List<Object>,org.kie.api.definition.rule.Rule,List<Object>> converter)
Deprecated.for removal from public API
-
-