public class HardSoftDoubleScoreHolder extends AbstractScoreHolder
HardSoftBigDecimalScoreHolder
instead.HardSoftDoubleScore
,
Serialized FormAbstractScoreHolder.ConstraintActivationUnMatchListener
Modifier and Type | Field and Description |
---|---|
protected double |
hardScore |
protected double |
softScore |
constraintMatchEnabled, constraintMatchTotalMap, indictmentMap, zeroScore
Constructor and Description |
---|
HardSoftDoubleScoreHolder(boolean constraintMatchEnabled) |
Modifier and Type | Method and Description |
---|---|
void |
addHardConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
double hardWeight) |
void |
addMultiConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
double hardWeight,
double softWeight) |
void |
addSoftConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
double softWeight) |
Score |
extractScore(int initScore)
|
double |
getHardScore() |
double |
getSoftScore() |
extractJustificationList, getConstraintMatchTotals, getIndictmentMap, isConstraintMatchEnabled, registerConstraintMatch
public HardSoftDoubleScoreHolder(boolean constraintMatchEnabled)
public double getHardScore()
public double getSoftScore()
public void addHardConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, double hardWeight)
kcontext
- never null, the magic variable in DRLhardWeight
- higher is better, negative for a penalty, positive for a rewardpublic void addSoftConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, double softWeight)
kcontext
- never null, the magic variable in DRLsoftWeight
- higher is better, negative for a penalty, positive for a rewardpublic void addMultiConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, double hardWeight, double softWeight)
kcontext
- never null, the magic variable in DRLhardWeight
- higher is better, negative for a penalty, positive for a rewardsoftWeight
- 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.