public class HardSoftLongScoreDefinition extends AbstractScoreDefinition<HardSoftLongScore>
Constructor and Description |
---|
HardSoftLongScoreDefinition() |
divide, divide, divide, divide, formatScore, getInitLabel, getLevelLabels, isCompatibleArithmeticArgument, sanitize, sanitize, sanitize, sanitize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isNegativeOrZero, isPositiveOrZero
public int getLevelsSize()
ScoreDefinition
Score.toLevelNumbers()
for every Score
of this definition.
For example: returns 2 on HardSoftScoreDefinition
.getLevelsSize
in interface ScoreDefinition<HardSoftLongScore>
getLevelsSize
in class AbstractScoreDefinition<HardSoftLongScore>
public int getFeasibleLevelsSize()
ScoreDefinition
Score.toLevelNumbers()
.
that are used to determine Score.isFeasible()
.ScoreDefinition.getLevelsSize()
public Class<HardSoftLongScore> getScoreClass()
ScoreDefinition
Class
of the actual Score
implementation.
For example: returns HardSoftScore.class
on HardSoftScoreDefinition
.public HardSoftLongScore getZeroScore()
ScoreDefinition
public HardSoftLongScore getOneSoftestScore()
ScoreDefinition
public HardSoftLongScore parseScore(String scoreString)
ScoreDefinition
scoreString
- never nullScoreDefinition.formatScore(Score)
,
ScoreUtils.parseScore(Class, String)
public HardSoftLongScore 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 HardSoftLongScoreInliner buildScoreInliner(boolean constraintMatchEnabled)
ScoreDefinition
BavetConstraintFactory
constraintMatchEnabled
- true if ScoreDirector.isConstraintMatchEnabled()
should be truepublic ScoreHolder buildScoreHolder(boolean constraintMatchEnabled)
ScoreDefinition
DroolsScoreDirector
.constraintMatchEnabled
- true if ScoreDirector.isConstraintMatchEnabled()
should be truepublic HardSoftLongScore buildOptimisticBound(InitializingScoreTrend initializingScoreTrend, HardSoftLongScore 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 HardSoftLongScore buildPessimisticBound(InitializingScoreTrend initializingScoreTrend, HardSoftLongScore 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
public HardSoftLongScore divideBySanitizedDivisor(HardSoftLongScore dividend, HardSoftLongScore divisor)
ScoreDefinition
Score
whose every level is the result of dividing the matching levels in this and the divisor.
When rounding is needed, it is floored (as defined by Math.floor(double)
).
If any of the levels in the divisor are equal to zero, the method behaves as if they were equal to one instead.
divisor
- value by which this Score is to be dividedCopyright © 2006–2021 JBoss by Red Hat. All rights reserved.