Class AbstractScoreHolder<Score_ extends Score<Score_>>
- java.lang.Object
-
- org.optaplanner.core.api.score.holder.AbstractScoreHolder<Score_>
-
- Type Parameters:
Score_
- theScore
type
- 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 class
AbstractScoreHolder.ConstraintActivationUnMatchListener
Deprecated.for removal from public API
-
Field Summary
Fields Modifier and Type Field Description protected boolean
constraintMatchEnabled
Deprecated.protected Map<String,ConstraintMatchTotal>
constraintMatchTotalMap
Deprecated.protected Map<Object,Indictment>
indictmentMap
Deprecated.protected Score_
zeroScore
Deprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractScoreHolder(boolean constraintMatchEnabled, Score_ zeroScore)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
configureConstraintWeight(org.kie.api.definition.rule.Rule rule, Score_ constraintWeight)
Deprecated.Sets up aConstraintWeight
from theConstraintConfiguration
during initialization.protected List<Object>
extractJustificationList(org.kie.api.runtime.rule.RuleContext kcontext)
Deprecated.Map<String,ConstraintMatchTotal>
getConstraintMatchTotalMap()
Deprecated.Explains theScore
ofScoreHolder.extractScore(int)
.Collection<ConstraintMatchTotal>
getConstraintMatchTotals()
Deprecated.Explains theScore
ofScoreHolder.extractScore(int)
.Map<Object,Indictment>
getIndictmentMap()
Deprecated.Explains the impact of each planning entity or problem fact on theScore
.void
impactScore(org.kie.api.runtime.rule.RuleContext kcontext)
Deprecated.For internal use only, use penalize() or reward() instead.void
impactScore(org.kie.api.runtime.rule.RuleContext kcontext, int weightMultiplier)
Deprecated.For internal use only, use penalize() or reward() instead.void
impactScore(org.kie.api.runtime.rule.RuleContext kcontext, long weightMultiplier)
Deprecated.For internal use only, use penalize() or reward() instead.void
impactScore(org.kie.api.runtime.rule.RuleContext kcontext, BigDecimal weightMultiplier)
Deprecated.For internal use only, use penalize() or reward() instead.boolean
isConstraintMatchEnabled()
Deprecated.Must be in sync withScoreDirector.isConstraintMatchEnabled()
for theScoreDirector
which contains thisScoreHolder
.protected void
registerConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, Runnable constraintUndoListener, Supplier<Score_> scoreSupplier)
Deprecated.Requires @OptaPlannerRuleEventListener
to be added as event listener onKieSession
, otherwise the score changes caused by the constraint matches would not be undone.void
setJustificationListConverter(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:ScoreHolder
Must be in sync withScoreDirector.isConstraintMatchEnabled()
for theScoreDirector
which contains thisScoreHolder
.Defaults to true.
- Specified by:
isConstraintMatchEnabled
in interfaceScoreHolder<Score_ extends Score<Score_>>
- Returns:
- false if the
ConstraintMatch
s andConstraintMatchTotal
s 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:ScoreHolder
Explains theScore
ofScoreHolder.extractScore(int)
.Should not be called directly, use
ScoreDirector.getConstraintMatchTotals()
instead.- Specified by:
getConstraintMatchTotals
in interfaceScoreHolder<Score_ extends Score<Score_>>
- Returns:
- never null
- See Also:
ScoreDirector.getConstraintMatchTotals()
-
getConstraintMatchTotalMap
public Map<String,ConstraintMatchTotal> getConstraintMatchTotalMap()
Deprecated.Description copied from interface:ScoreHolder
Explains theScore
ofScoreHolder.extractScore(int)
.Should not be called directly, use
ScoreDirector.getConstraintMatchTotalMap()
instead.- Specified by:
getConstraintMatchTotalMap
in interfaceScoreHolder<Score_ extends Score<Score_>>
- Returns:
- never null
- See Also:
ScoreDirector.getConstraintMatchTotalMap()
-
getIndictmentMap
public Map<Object,Indictment> getIndictmentMap()
Deprecated.Description copied from interface:ScoreHolder
Explains the impact of each planning entity or problem fact on theScore
.Should not be called directly, use
ScoreDirector.getIndictmentMap()
instead.- Specified by:
getIndictmentMap
in 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:ScoreHolder
Sets up aConstraintWeight
from theConstraintConfiguration
during initialization.- Specified by:
configureConstraintWeight
in 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 @OptaPlannerRuleEventListener
to 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
-
-