S
- the actual score typepublic abstract class AbstractScore<S extends Score> extends Object implements Score<S>, Serializable
Score
.
Subclasses must be immutable.
Score
,
HardSoftScore
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected static String |
INIT_LABEL |
protected int |
initScore |
Modifier | Constructor and Description |
---|---|
protected |
AbstractScore(int initScore) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertNoInitScore() |
protected static String |
buildScorePattern(boolean bendable,
String... levelSuffixes) |
protected String |
buildShortString(Predicate<Number> notZero,
String... levelLabels) |
protected String |
getInitPrefix() |
int |
getInitScore()
The init score is the negative of the number of uninitialized genuine planning variables.
|
boolean |
isSolutionInitialized()
Checks if the
PlanningSolution of this score was fully initialized when it was calculated. |
protected static int |
parseInitScore(Class<? extends Score> scoreClass,
String scoreString,
String initScoreString) |
protected static BigDecimal |
parseLevelAsBigDecimal(Class<? extends Score> scoreClass,
String scoreString,
String levelString) |
protected static double |
parseLevelAsDouble(Class<? extends Score> scoreClass,
String scoreString,
String levelString) |
protected static int |
parseLevelAsInt(Class<? extends Score> scoreClass,
String scoreString,
String levelString) |
protected static long |
parseLevelAsLong(Class<? extends Score> scoreClass,
String scoreString,
String levelString) |
protected static String[] |
parseScoreTokens(Class<? extends Score> scoreClass,
String scoreString,
String... levelSuffixes) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, divide, isCompatibleArithmeticArgument, multiply, negate, power, subtract, toInitializedScore, toLevelNumbers, toShortString, withInitScore
compareTo
protected static final String INIT_LABEL
protected final int initScore
protected AbstractScore(int initScore)
initScore
- see Score.getInitScore()
protected static String[] parseScoreTokens(Class<? extends Score> scoreClass, String scoreString, String... levelSuffixes)
protected static int parseInitScore(Class<? extends Score> scoreClass, String scoreString, String initScoreString)
protected static int parseLevelAsInt(Class<? extends Score> scoreClass, String scoreString, String levelString)
protected static long parseLevelAsLong(Class<? extends Score> scoreClass, String scoreString, String levelString)
protected static double parseLevelAsDouble(Class<? extends Score> scoreClass, String scoreString, String levelString)
protected static BigDecimal parseLevelAsBigDecimal(Class<? extends Score> scoreClass, String scoreString, String levelString)
protected static String buildScorePattern(boolean bendable, String... levelSuffixes)
public int getInitScore()
Score
PlanningSolution
is fully initialized
and the score's Object.toString()
does not mention it.
During Comparable.compareTo(Object)
, it's even more important than the hard score:
if you don't want this behaviour, read about overconstrained planning in the reference manual.
getInitScore
in interface Score<S extends Score>
public boolean isSolutionInitialized()
Score
PlanningSolution
of this score was fully initialized when it was calculated.isSolutionInitialized
in interface Score<S extends Score>
Score.getInitScore()
is 0protected void assertNoInitScore()
protected String getInitPrefix()
Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.