public interface ScoreDefinition<S extends Score<S>>
AbstractScoreDefinition
,
HardSoftScoreDefinition
Modifier and Type | Method and Description |
---|---|
S |
buildOptimisticBound(InitializingScoreTrend initializingScoreTrend,
S score)
|
S |
buildPessimisticBound(InitializingScoreTrend initializingScoreTrend,
S score)
|
ScoreHolder<S> |
buildScoreHolder(boolean constraintMatchEnabled)
Used by
DroolsScoreDirector . |
ScoreInliner<S> |
buildScoreInliner(boolean constraintMatchEnabled)
Used by
BavetConstraintFactory |
String |
formatScore(S score)
|
S |
fromLevelNumbers(int initScore,
Number[] levelNumbers)
The opposite of
Score.toLevelNumbers() . |
String |
getInitLabel()
Returns the label for
Score.getInitScore() . |
String[] |
getLevelLabels()
Returns a label for each score level.
|
int |
getLevelsSize()
Returns the length of
Score.toLevelNumbers() for every Score of this definition. |
Class<S> |
getScoreClass()
|
S |
getZeroScore()
The score that represents zero.
|
default boolean |
isNegativeOrZero(S score) |
default boolean |
isPositiveOrZero(S score) |
S |
parseScore(String scoreString)
|
String getInitLabel()
Score.getInitScore()
.getLevelLabels()
int getLevelsSize()
Score.toLevelNumbers()
for every Score
of this definition.
For example: returns 2 on HardSoftScoreDefinition
.String[] getLevelLabels()
{"hard score", "soft score "}
on HardSoftScoreDefinition
.
It does not include the getInitLabel()
.
getLevelsSize()
, each element is never nullClass<S> getScoreClass()
Class
of the actual Score
implementation.
For example: returns HardSoftScore.class
on HardSoftScoreDefinition
.S getZeroScore()
default boolean isPositiveOrZero(S score)
score
- never nullgetZeroScore()
default boolean isNegativeOrZero(S score)
score
- never nullgetZeroScore()
String formatScore(S score)
score
- never nullparseScore(String)
S parseScore(String scoreString)
scoreString
- never nullformatScore(Score)
,
ScoreUtils.parseScore(Class, String)
S fromLevelNumbers(int initScore, Number[] levelNumbers)
Score.toLevelNumbers()
.initScore
- <= 0
, managed by OptaPlanner, needed as a parameter in the Score
's creation
method, see Score.getInitScore()
levelNumbers
- never nullScoreInliner<S> buildScoreInliner(boolean constraintMatchEnabled)
BavetConstraintFactory
constraintMatchEnabled
- true if ScoreDirector.isConstraintMatchEnabled()
should be trueScoreHolder<S> buildScoreHolder(boolean constraintMatchEnabled)
DroolsScoreDirector
.constraintMatchEnabled
- true if ScoreDirector.isConstraintMatchEnabled()
should be trueS buildOptimisticBound(InitializingScoreTrend initializingScoreTrend, S score)
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 getLevelsSize()
.score
- never null, with Score.getInitScore()
0
.S buildPessimisticBound(InitializingScoreTrend initializingScoreTrend, S score)
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 getLevelsSize()
.score
- never null, with Score.getInitScore()
0
Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.