Record Class InnerScore<Score_ extends Score<Score_>>

java.lang.Object
java.lang.Record
ai.timefold.solver.core.impl.score.director.InnerScore<Score_>
All Implemented Interfaces:
Comparable<InnerScore<Score_>>

@NullMarked public record InnerScore<Score_ extends Score<Score_>>(Score_ extends Score<Score_> raw, int unassignedCount) extends Record implements Comparable<InnerScore<Score_>>
Carries information on if the PlanningSolution of this score was fully initialized when it was calculated. This only works for solutions where: For solutions which do allow unassigning values, unassignedCount is always zero.
  • Constructor Details

    • InnerScore

      public InnerScore(Score_ raw, int unassignedCount)
      Creates an instance of a InnerScore record class.
      Parameters:
      raw - the value for the raw record component
      unassignedCount - the value for the unassignedCount record component
  • Method Details

    • fullyAssigned

      public static <Score_ extends Score<Score_>> InnerScore<Score_> fullyAssigned(Score_ score)
    • withUnassignedCount

      public static <Score_ extends Score<Score_>> InnerScore<Score_> withUnassignedCount(Score_ score, int unassignedCount)
    • isFullyAssigned

      public boolean isFullyAssigned()
    • compareTo

      public int compareTo(InnerScore<Score_> other)
      Specified by:
      compareTo in interface Comparable<Score_ extends Score<Score_>>
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • raw

      public Score_ raw()
      Returns the value of the raw record component.
      Returns:
      the value of the raw record component
    • unassignedCount

      public int unassignedCount()
      Returns the value of the unassignedCount record component.
      Returns:
      the value of the unassignedCount record component