Score_ - the Score type@Deprecated public abstract class AbstractScoreHolder<Score_ extends Score<Score_>> extends Object implements ScoreHolder<Score_>, Serializable
ScoreHolder.| Modifier and Type | Class and Description |
|---|---|
class |
AbstractScoreHolder.ConstraintActivationUnMatchListener
Deprecated.
for removal from public API
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
constraintMatchEnabled
Deprecated.
|
protected Map<String,ConstraintMatchTotal> |
constraintMatchTotalMap
Deprecated.
|
protected Map<Object,Indictment> |
indictmentMap
Deprecated.
|
protected Score_ |
zeroScore
Deprecated.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractScoreHolder(boolean constraintMatchEnabled,
Score_ zeroScore)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configureConstraintWeight(org.kie.api.definition.rule.Rule rule,
Score_ constraintWeight)
Deprecated.
Sets up a
ConstraintWeight from the ConstraintConfiguration during initialization. |
protected List<Object> |
extractJustificationList(org.kie.api.runtime.rule.RuleContext kcontext)
Deprecated.
|
Map<String,ConstraintMatchTotal> |
getConstraintMatchTotalMap()
Deprecated.
Explains the
Score of ScoreHolder.extractScore(int). |
Collection<ConstraintMatchTotal> |
getConstraintMatchTotals()
Deprecated.
Explains the
Score of ScoreHolder.extractScore(int). |
Map<Object,Indictment> |
getIndictmentMap()
Deprecated.
Explains the impact of each planning entity or problem fact on the
Score. |
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,
BigDecimal weightMultiplier)
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.
|
boolean |
isConstraintMatchEnabled()
Deprecated.
Must be in sync with
ScoreDirector.isConstraintMatchEnabled()
for the ScoreDirector which contains this ScoreHolder. |
protected void |
registerConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
Runnable constraintUndoListener,
Supplier<Score_> scoreSupplier)
Deprecated.
Requires @
OptaPlannerRuleEventListener to be added as event listener on KieSession, 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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitextractScoreprotected final boolean constraintMatchEnabled
protected final Map<String,ConstraintMatchTotal> constraintMatchTotalMap
protected final Map<Object,Indictment> indictmentMap
protected AbstractScoreHolder(boolean constraintMatchEnabled,
Score_ zeroScore)
public boolean isConstraintMatchEnabled()
ScoreHolderScoreDirector.isConstraintMatchEnabled()
for the ScoreDirector which contains this ScoreHolder.
Defaults to true.
isConstraintMatchEnabled in interface ScoreHolder<Score_ extends Score<Score_>>ConstraintMatchs and ConstraintMatchTotals do not need to be collected
which is a performance boostScoreHolder.getConstraintMatchTotals()public Collection<ConstraintMatchTotal> getConstraintMatchTotals()
ScoreHolderScore of ScoreHolder.extractScore(int).
Should not be called directly, use ScoreDirector.getConstraintMatchTotals() instead.
getConstraintMatchTotals in interface ScoreHolder<Score_ extends Score<Score_>>ScoreDirector.getConstraintMatchTotals()public Map<String,ConstraintMatchTotal> getConstraintMatchTotalMap()
ScoreHolderScore of ScoreHolder.extractScore(int).
Should not be called directly, use ScoreDirector.getConstraintMatchTotalMap() instead.
getConstraintMatchTotalMap in interface ScoreHolder<Score_ extends Score<Score_>>ScoreDirector.getConstraintMatchTotalMap()public Map<Object,Indictment> getIndictmentMap()
ScoreHolderScore.
Should not be called directly, use ScoreDirector.getIndictmentMap() instead.
getIndictmentMap in interface ScoreHolder<Score_ extends Score<Score_>>ScoreDirector.getIndictmentMap()public void configureConstraintWeight(org.kie.api.definition.rule.Rule rule,
Score_ constraintWeight)
ScoreHolderConstraintWeight from the ConstraintConfiguration during initialization.configureConstraintWeight in interface ScoreHolder<Score_ extends Score<Score_>>rule - never nullconstraintWeight - never null, with Score.getInitScore() equal to 0.protected void registerConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
Runnable constraintUndoListener,
Supplier<Score_> scoreSupplier)
OptaPlannerRuleEventListener to be added as event listener on KieSession, otherwise the
score changes caused by the constraint matches would not be undone. See
DroolsScoreDirector.resetKieSession() for an example.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.public void impactScore(org.kie.api.runtime.rule.RuleContext kcontext)
kcontext - never nullpublic void impactScore(org.kie.api.runtime.rule.RuleContext kcontext,
int weightMultiplier)
kcontext - never nullweightMultiplier - anypublic void impactScore(org.kie.api.runtime.rule.RuleContext kcontext,
long weightMultiplier)
kcontext - never nullweightMultiplier - anypublic void impactScore(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal weightMultiplier)
kcontext - never nullweightMultiplier - anyprotected List<Object> extractJustificationList(org.kie.api.runtime.rule.RuleContext kcontext)
@Deprecated public void setJustificationListConverter(BiFunction<List<Object>,org.kie.api.definition.rule.Rule,List<Object>> converter)
Copyright © 2006–2021 JBoss by Red Hat. All rights reserved.