public class HardSoftScoreDefinition extends AbstractFeasibilityScoreDefinition<HardSoftScore>
Constructor and Description |
---|
HardSoftScoreDefinition() |
Modifier and Type | Method and Description |
---|---|
HardSoftScore |
buildOptimisticBound(InitializingScoreTrend initializingScoreTrend,
HardSoftScore score)
|
HardSoftScore |
buildPessimisticBound(InitializingScoreTrend initializingScoreTrend,
HardSoftScore score)
|
HardSoftScoreHolder |
buildScoreHolder(boolean constraintMatchEnabled)
Used by
DroolsScoreDirector . |
HardSoftScoreInliner |
buildScoreInliner(boolean constraintMatchEnabled)
Used by
BavetConstraintFactory |
HardSoftScore |
fromLevelNumbers(int initScore,
Number[] levelNumbers)
The opposite of
Score.toLevelNumbers() . |
int |
getFeasibleLevelsSize()
Returns the number of levels of
Score.toLevelNumbers() . |
Class<HardSoftScore> |
getScoreClass()
|
HardSoftScore |
getZeroScore()
The score that represents zero.
|
HardSoftScore |
parseScore(String scoreString)
|
formatScore, getInitLabel, getLevelLabels, getLevelsSize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
formatScore, getInitLabel, getLevelLabels, getLevelsSize, isNegativeOrZero, isPositiveOrZero
public int getFeasibleLevelsSize()
FeasibilityScoreDefinition
Score.toLevelNumbers()
.
that are used to determine FeasibilityScore.isFeasible()
.ScoreDefinition.getLevelsSize()
public Class<HardSoftScore> getScoreClass()
ScoreDefinition
Class
of the actual Score
implementation.
For example: returns HardSoftScore.class
on HardSoftScoreDefinition
.public HardSoftScore getZeroScore()
ScoreDefinition
public HardSoftScore parseScore(String scoreString)
ScoreDefinition
scoreString
- never nullScoreDefinition.formatScore(Score)
,
ScoreUtils.parseScore(Class, String)
public HardSoftScore fromLevelNumbers(int initScore, Number[] levelNumbers)
ScoreDefinition
Score.toLevelNumbers()
.initScore
- <= 0
, managed by OptaPlanner, needed as a parameter in the Score
's creation
method, see Score.getInitScore()
levelNumbers
- never nullpublic HardSoftScoreInliner buildScoreInliner(boolean constraintMatchEnabled)
ScoreDefinition
BavetConstraintFactory
constraintMatchEnabled
- true if ScoreDirector.isConstraintMatchEnabled()
should be truepublic HardSoftScoreHolder buildScoreHolder(boolean constraintMatchEnabled)
ScoreDefinition
DroolsScoreDirector
.constraintMatchEnabled
- true if ScoreDirector.isConstraintMatchEnabled()
should be truepublic HardSoftScore buildOptimisticBound(InitializingScoreTrend initializingScoreTrend, HardSoftScore score)
ScoreDefinition
Score
which is equal or better than any other Score
with more variables initialized
(while the already variables don't change).initializingScoreTrend
- never null, with InitializingScoreTrend.getLevelsSize()
equal to ScoreDefinition.getLevelsSize()
.score
- never null, with Score.getInitScore()
0
.public HardSoftScore buildPessimisticBound(InitializingScoreTrend initializingScoreTrend, HardSoftScore score)
ScoreDefinition
Score
which is equal or worse than any other Score
with more variables initialized
(while the already variables don't change).initializingScoreTrend
- never null, with InitializingScoreTrend.getLevelsSize()
equal to ScoreDefinition.getLevelsSize()
.score
- never null, with Score.getInitScore()
0
Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.