Class AbstractBendableScoreDefinition<Score_ extends Score<Score_>>
- java.lang.Object
-
- org.optaplanner.core.impl.score.definition.AbstractScoreDefinition<Score_>
-
- org.optaplanner.core.impl.score.definition.AbstractBendableScoreDefinition<Score_>
-
- All Implemented Interfaces:
ScoreDefinition<Score_>
- Direct Known Subclasses:
BendableBigDecimalScoreDefinition
,BendableLongScoreDefinition
,BendableScoreDefinition
public abstract class AbstractBendableScoreDefinition<Score_ extends Score<Score_>> extends AbstractScoreDefinition<Score_> implements ScoreDefinition<Score_>
-
-
Field Summary
Fields Modifier and Type Field Description protected int
hardLevelsSize
protected int
softLevelsSize
-
Constructor Summary
Constructors Constructor Description AbstractBendableScoreDefinition(int hardLevelsSize, int softLevelsSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static String[]
generateLevelLabels(int hardLevelsSize, int softLevelsSize)
int
getFeasibleLevelsSize()
Returns the number of levels ofScore.toLevelNumbers()
.int
getHardLevelsSize()
int
getLevelsSize()
Returns the length ofScore.toLevelNumbers()
for everyScore
of this definition.int
getSoftLevelsSize()
boolean
isCompatibleArithmeticArgument(Score score)
-
Methods inherited from class org.optaplanner.core.impl.score.definition.AbstractScoreDefinition
divide, divide, divide, divide, formatScore, getInitLabel, getLevelLabels, sanitize, sanitize, sanitize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.optaplanner.core.impl.score.definition.ScoreDefinition
buildOptimisticBound, buildPessimisticBound, divideBySanitizedDivisor, formatScore, fromLevelNumbers, getInitLabel, getLevelLabels, getOneSoftestScore, getScoreClass, getZeroScore, isNegativeOrZero, isPositiveOrZero, parseScore
-
-
-
-
Method Detail
-
generateLevelLabels
protected static String[] generateLevelLabels(int hardLevelsSize, int softLevelsSize)
-
getHardLevelsSize
public int getHardLevelsSize()
-
getSoftLevelsSize
public int getSoftLevelsSize()
-
getLevelsSize
public int getLevelsSize()
Description copied from interface:ScoreDefinition
Returns the length ofScore.toLevelNumbers()
for everyScore
of this definition. For example: returns 2 onHardSoftScoreDefinition
.- Specified by:
getLevelsSize
in interfaceScoreDefinition<Score_ extends Score<Score_>>
- Overrides:
getLevelsSize
in classAbstractScoreDefinition<Score_ extends Score<Score_>>
- Returns:
- at least 1
-
getFeasibleLevelsSize
public int getFeasibleLevelsSize()
Description copied from interface:ScoreDefinition
Returns the number of levels ofScore.toLevelNumbers()
. that are used to determineScore.isFeasible()
.- Specified by:
getFeasibleLevelsSize
in interfaceScoreDefinition<Score_ extends Score<Score_>>
- Returns:
- at least 0, at most
ScoreDefinition.getLevelsSize()
-
isCompatibleArithmeticArgument
public boolean isCompatibleArithmeticArgument(Score score)
- Specified by:
isCompatibleArithmeticArgument
in interfaceScoreDefinition<Score_ extends Score<Score_>>
- Overrides:
isCompatibleArithmeticArgument
in classAbstractScoreDefinition<Score_ extends Score<Score_>>
- Parameters:
score
- never null- Returns:
- true if the otherScore is accepted as a parameter of
Score.add(Score)
,Score.subtract(Score)
andComparable.compareTo(Object)
for scores of this score definition.
-
-