public class HardMediumSoftBigDecimalScoreHolder extends AbstractScoreHolder
HardMediumSoftBigDecimalScore
,
Serialized FormAbstractScoreHolder.ConstraintActivationUnMatchListener
Modifier and Type | Field and Description |
---|---|
protected BigDecimal |
hardScore |
protected BigDecimal |
mediumScore |
protected BigDecimal |
softScore |
constraintMatchEnabled, constraintMatchTotalMap, indictmentMap, zeroScore
Constructor and Description |
---|
HardMediumSoftBigDecimalScoreHolder(boolean constraintMatchEnabled) |
Modifier and Type | Method and Description |
---|---|
void |
addHardConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal hardWeight)
Add a hard constraint of specified weighting.
|
void |
addMediumConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal mediumWeight)
Add a medium level constraint of specified weighting.
|
void |
addMultiConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal hardWeight,
BigDecimal mediumWeight,
BigDecimal softWeight) |
void |
addSoftConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal softWeight)
Add a soft constraint match of specified weighting.
|
Score |
extractScore(int initScore)
|
BigDecimal |
getHardScore() |
BigDecimal |
getMediumScore() |
BigDecimal |
getSoftScore() |
extractJustificationList, getConstraintMatchTotals, getIndictmentMap, isConstraintMatchEnabled, registerConstraintMatch
protected BigDecimal hardScore
protected BigDecimal mediumScore
protected BigDecimal softScore
public HardMediumSoftBigDecimalScoreHolder(boolean constraintMatchEnabled)
public BigDecimal getHardScore()
public BigDecimal getMediumScore()
public BigDecimal getSoftScore()
public void addHardConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, BigDecimal hardWeight)
kcontext
- never null, the magic variable in DRLhardWeight
- never null, higher is better, negative for a penalty, positive for a rewardpublic void addMediumConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, BigDecimal mediumWeight)
kcontext
- never null, the magic variable in DRLmediumWeight
- never null, higher is better, negative for a penalty, positive for a rewardpublic void addSoftConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, BigDecimal softWeight)
kcontext
- never null, the magic variable in DRLsoftWeight
- never null, higher is better, negative for a penalty, positive for a rewardpublic void addMultiConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, BigDecimal hardWeight, BigDecimal mediumWeight, BigDecimal softWeight)
kcontext
- never null, the magic variable in DRLhardWeight
- never null, higher is better, negative for a penalty, positive for a rewardmediumWeight
- never null, higher is better, negative for a penalty, positive for a rewardsoftWeight
- never null, higher is better, negative for a penalty, positive for a rewardpublic Score extractScore(int initScore)
ScoreHolder
Score
, calculated by the KieSession
for DroolsScoreDirector
.
Should not be called directly, use ScoreDirector.calculateScore()
instead.
initScore
- <= 0
, managed by OptaPlanner, needed as a parameter in the Score
's creation
method, see Score.getInitScore()
Score
of the working PlanningSolution
Copyright © 2006–2017 JBoss by Red Hat. All rights reserved.