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
Modifier and TypeFieldDescriptionprotected final int
protected final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String[]
generateLevelLabels
(int hardLevelsSize, int softLevelsSize) int
Returns the number of levels ofScore.toLevelNumbers()
.int
int
Returns the length ofScore.toLevelNumbers()
for everyScore
of this definition.int
boolean
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, getNumericType, getOneSoftestScore, getScoreClass, getZeroScore, isNegativeOrZero, isPositiveOrZero, parseScore
-
Field Details
-
hardLevelsSize
protected final int hardLevelsSize -
softLevelsSize
protected final int softLevelsSize
-
-
Constructor Details
-
AbstractBendableScoreDefinition
public AbstractBendableScoreDefinition(int hardLevelsSize, int softLevelsSize)
-
-
Method Details
-
generateLevelLabels
-
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
- 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.
-