Interface ScoreHolder<Score_ extends Score<Score_>>
-
- Type Parameters:
Score_
- theScore
type
- All Known Implementing Classes:
AbstractScoreHolder
,BendableBigDecimalScoreHolder
,BendableLongScoreHolder
,BendableScoreHolder
,HardMediumSoftBigDecimalScoreHolder
,HardMediumSoftLongScoreHolder
,HardMediumSoftScoreHolder
,HardSoftBigDecimalScoreHolder
,HardSoftDoubleScoreHolder
,HardSoftLongScoreHolder
,HardSoftScoreHolder
,SimpleBigDecimalScoreHolder
,SimpleDoubleScoreHolder
,SimpleLongScoreHolder
,SimpleScoreHolder
public interface ScoreHolder<Score_ extends Score<Score_>>
This class is injected as a global byDroolsScoreDirector
into the Drools DRL. OtherScoreDirector
implementations do not use this class.An implementation must extend
AbstractScoreHolder
to ensure backwards compatibility in future versions.- See Also:
AbstractScoreHolder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
configureConstraintWeight(org.kie.api.definition.rule.Rule rule, Score_ constraintWeight)
Deprecated.for removal from public APIScore_
extractScore(int initScore)
Deprecated.for removal from public API, seeScoreManager
.Map<String,ConstraintMatchTotal>
getConstraintMatchTotalMap()
Deprecated.for removal from public API, seeScoreManager
Collection<ConstraintMatchTotal>
getConstraintMatchTotals()
Deprecated.for removal from public API, seeScoreManager
Map<Object,Indictment>
getIndictmentMap()
Deprecated.for removal from public API, seeScoreManager
boolean
isConstraintMatchEnabled()
Deprecated.for removal from public API
-
-
-
Method Detail
-
extractScore
@Deprecated Score_ extractScore(int initScore)
Deprecated.for removal from public API, seeScoreManager
.Extracts theScore
, calculated by theKieSession
forDroolsScoreDirector
.Should not be called directly, use
ScoreDirector.calculateScore()
instead.- Parameters:
initScore
-<= 0
, managed by OptaPlanner, needed as a parameter in theScore
's creation method, seeScore.getInitScore()
- Returns:
- never null, the
Score
of the workingPlanningSolution
-
configureConstraintWeight
@Deprecated void configureConstraintWeight(org.kie.api.definition.rule.Rule rule, Score_ constraintWeight)
Deprecated.for removal from public APISets up aConstraintWeight
from theConstraintConfiguration
during initialization.- Parameters:
rule
- never nullconstraintWeight
- never null, withScore.getInitScore()
equal to 0.
-
isConstraintMatchEnabled
@Deprecated boolean isConstraintMatchEnabled()
Deprecated.for removal from public APIMust be in sync withScoreDirector.isConstraintMatchEnabled()
for theScoreDirector
which contains thisScoreHolder
.Defaults to true.
- Returns:
- false if the
ConstraintMatch
s andConstraintMatchTotal
s do not need to be collected which is a performance boost - See Also:
getConstraintMatchTotals()
-
getConstraintMatchTotals
@Deprecated Collection<ConstraintMatchTotal> getConstraintMatchTotals()
Deprecated.for removal from public API, seeScoreManager
Explains theScore
ofextractScore(int)
.Should not be called directly, use
ScoreDirector.getConstraintMatchTotals()
instead.- Returns:
- never null
- Throws:
IllegalStateException
- ifisConstraintMatchEnabled()
is false- See Also:
ScoreDirector.getConstraintMatchTotals()
-
getConstraintMatchTotalMap
@Deprecated Map<String,ConstraintMatchTotal> getConstraintMatchTotalMap()
Deprecated.for removal from public API, seeScoreManager
Explains theScore
ofextractScore(int)
.Should not be called directly, use
ScoreDirector.getConstraintMatchTotalMap()
instead.- Returns:
- never null
- Throws:
IllegalStateException
- ifisConstraintMatchEnabled()
is false- See Also:
ScoreDirector.getConstraintMatchTotalMap()
-
getIndictmentMap
@Deprecated Map<Object,Indictment> getIndictmentMap()
Deprecated.for removal from public API, seeScoreManager
Explains the impact of each planning entity or problem fact on theScore
.Should not be called directly, use
ScoreDirector.getIndictmentMap()
instead.- Returns:
- never null
- Throws:
IllegalStateException
- ifisConstraintMatchEnabled()
returns false- See Also:
ScoreDirector.getIndictmentMap()
-
-