Class AbstractScore<Score_ extends AbstractScore<Score_>>

java.lang.Object
ai.timefold.solver.core.api.score.AbstractScore<Score_>
Type Parameters:
Score_ - the actual score type
All Implemented Interfaces:
Score<Score_>, Serializable, Comparable<Score_>
Direct Known Subclasses:
AbstractBendableScore

@Deprecated(forRemoval=true) public abstract class AbstractScore<Score_ extends AbstractScore<Score_>> extends Object implements Score<Score_>, Serializable
Deprecated, for removal: This API element is subject to removal in a future version.
Implement Score instead.
Abstract superclass for Score.

Subclasses must be immutable.

See Also:
  • Field Details

    • INIT_LABEL

      protected static final String INIT_LABEL
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • initScore

      protected final int initScore
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • AbstractScore

      protected AbstractScore(int initScore)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      initScore - see Score.initScore()
  • Method Details

    • parseScoreTokens

      protected static String[] parseScoreTokens(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String... levelSuffixes)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • parseInitScore

      protected static int parseInitScore(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String initScoreString)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • parseLevelAsInt

      protected static int parseLevelAsInt(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String levelString)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • parseLevelAsLong

      protected static long parseLevelAsLong(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String levelString)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • parseLevelAsBigDecimal

      protected static BigDecimal parseLevelAsBigDecimal(Class<? extends AbstractScore<?>> scoreClass, String scoreString, String levelString)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • buildScorePattern

      protected static String buildScorePattern(boolean bendable, String... levelSuffixes)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • initScore

      public int initScore()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Score
      The init score is the negative of the number of genuine planning variables set to null, unless null values are specifically allowed by PlanningVariable.allowsUnassigned() or PlanningListVariable.allowsUnassignedValues() Nulls are typically only allowed in over-constrained planning. In that case, there is no way how to tell a fully initialized solution with some values left unassigned, from a partially initialized solution where the initialization of some values wasn't yet attempted.

      During Comparable.compareTo(Object), init score is considered more important than the hard score. If the init score is 0 (which it usually is), the score's Object.toString() does not mention it.

      Specified by:
      initScore in interface Score<Score_ extends AbstractScore<Score_>>
      Returns:
      higher is better, always negative (except in statistical calculations); 0 if all planning variables are non-null, or if nulls are allowed.
    • getInitPrefix

      protected String getInitPrefix()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • buildShortString

      protected String buildShortString(Predicate<Number> notZero, String... levelLabels)
      Deprecated, for removal: This API element is subject to removal in a future version.