Record Class TSState

java.lang.Object
java.lang.Record
org.ddolib.examples.talentscheduling.TSState
Record Components:
remainingScenes - scenes that must still be scheduled
maybeScenes - scenes that may still be scheduled due to state merging
onLocationActors - actors currently available on location

public record TSState(BitSet remainingScenes, BitSet maybeScenes, BitSet onLocationActors) extends Record
Represents a state in the Talent Scheduling Problem (TalentSched).

A state keeps track of:

  • remainingScenes — a BitSet containing all scenes that still need to be scheduled.
  • maybeScenes — a BitSet used in merged or relaxed states, containing scenes that may need to be scheduled in some merged branches but have already been scheduled in others.
  • onLocationActors — a BitSet representing which actors are currently on location.

The combination of remainingScenes and maybeScenes allows the solver to represent both definite and potential scheduling decisions in relaxed or merged states. The onLocationActors field helps track actor availability for scene scheduling.

This record is typically used in decision diagram-based solvers, branch-and-bound, or relaxation algorithms for the TSP.

  • Constructor Details

    • TSState

      public TSState(BitSet remainingScenes, BitSet maybeScenes, BitSet onLocationActors)
      Creates an instance of a TSState record class.
      Parameters:
      remainingScenes - the value for the remainingScenes record component
      maybeScenes - the value for the maybeScenes record component
      onLocationActors - the value for the onLocationActors record component
  • Method Details

    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • remainingScenes

      public BitSet remainingScenes()
      Returns the value of the remainingScenes record component.
      Returns:
      the value of the remainingScenes record component
    • maybeScenes

      public BitSet maybeScenes()
      Returns the value of the maybeScenes record component.
      Returns:
      the value of the maybeScenes record component
    • onLocationActors

      public BitSet onLocationActors()
      Returns the value of the onLocationActors record component.
      Returns:
      the value of the onLocationActors record component