Package org.optaplanner.core.api.score
Class AbstractScore<Score_ extends AbstractScore<Score_>>
- java.lang.Object
- 
- org.optaplanner.core.api.score.AbstractScore<Score_>
 
- 
- Type Parameters:
- Score_- the actual score type
 - All Implemented Interfaces:
- Serializable,- Comparable<Score_>,- Score<Score_>
 - Direct Known Subclasses:
- AbstractBendableScore,- HardMediumSoftBigDecimalScore,- HardMediumSoftLongScore,- HardMediumSoftScore,- HardSoftBigDecimalScore,- HardSoftLongScore,- HardSoftScore,- SimpleBigDecimalScore,- SimpleLongScore,- SimpleScore
 
 public abstract class AbstractScore<Score_ extends AbstractScore<Score_>> extends Object implements Score<Score_>, Serializable Abstract superclass forScore.Subclasses must be immutable. - See Also:
- Score,- HardSoftScore, Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static StringINIT_LABELprotected intinitScore
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractScore(int initScore)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static StringbuildScorePattern(boolean bendable, String... levelSuffixes)protected StringbuildShortString(Predicate<Number> notZero, String... levelLabels)protected StringgetInitPrefix()intgetInitScore()The init score is the negative of the number of uninitialized genuine planning variables.booleanisSolutionInitialized()Checks if thePlanningSolutionof this score was fully initialized when it was calculated.protected static intparseInitScore(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String initScoreString)protected static BigDecimalparseLevelAsBigDecimal(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String levelString)protected static intparseLevelAsInt(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String levelString)protected static longparseLevelAsLong(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String levelString)protected static String[]parseScoreTokens(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String... levelSuffixes)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.lang.ComparablecompareTo
 - 
Methods inherited from interface org.optaplanner.core.api.score.Scoreadd, divide, isFeasible, multiply, negate, power, subtract, toLevelNumbers, toShortString, withInitScore
 
- 
 
- 
- 
- 
Field Detail- 
INIT_LABELprotected static final String INIT_LABEL - See Also:
- Constant Field Values
 
 - 
initScoreprotected final int initScore 
 
- 
 - 
Constructor Detail- 
AbstractScoreprotected AbstractScore(int initScore) - Parameters:
- initScore- see- Score.getInitScore()
 
 
- 
 - 
Method Detail- 
parseScoreTokensprotected static String[] parseScoreTokens(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String... levelSuffixes) 
 - 
parseInitScoreprotected static int parseInitScore(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String initScoreString) 
 - 
parseLevelAsIntprotected static int parseLevelAsInt(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String levelString) 
 - 
parseLevelAsLongprotected static long parseLevelAsLong(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String levelString) 
 - 
parseLevelAsBigDecimalprotected static BigDecimal parseLevelAsBigDecimal(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String levelString) 
 - 
buildScorePatternprotected static String buildScorePattern(boolean bendable, String... levelSuffixes) 
 - 
getInitScorepublic int getInitScore() Description copied from interface:ScoreThe init score is the negative of the number of uninitialized genuine planning variables. If it's 0 (which it usually is), thePlanningSolutionis fully initialized and the score'sObject.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.- Specified by:
- getInitScorein interface- Score<Score_ extends AbstractScore<Score_>>
- Returns:
- higher is better, always negative (except in statistical calculations), 0 if all planning variables are initialized
 
 - 
isSolutionInitializedpublic boolean isSolutionInitialized() Description copied from interface:ScoreChecks if thePlanningSolutionof this score was fully initialized when it was calculated.- Specified by:
- isSolutionInitializedin interface- Score<Score_ extends AbstractScore<Score_>>
- Returns:
- true if Score.getInitScore()is 0
 
 - 
getInitPrefixprotected String getInitPrefix() 
 
- 
 
-