Record Class SRFLPState

java.lang.Object
java.lang.Record
org.ddolib.examples.srflp.SRFLPState
Record Components:
must - The set of departments that must still be placed in all possible completions of the current state. Represented as a BitSet.
maybe - The set of departments that must be placed for some of the merged states, but may have already been placed in others. Used primarily in relaxed/merged states.
cut - An array containing, for each free department, the sum of all traffic intensities from the fixed departments to that department.
depth - The depth of the state in the associated decision diagram or search tree.

public record SRFLPState(BitSet must, BitSet maybe, int[] cut, int depth) extends Record
Represents a state in a Single Row Facility Layout Problem (SRFLP) instance.

Each state keeps track of which departments must still be placed, which departments are optional (in case of merged nodes), the cumulative cut values, and the depth in the decision diagram or search tree.

  • Constructor Summary

    Constructors
    Constructor
    Description
    SRFLPState(BitSet must, BitSet maybe, int[] cut, int depth)
    Creates an instance of a SRFLPState record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int[]
    cut()
    Returns the value of the cut record component.
    int
    Returns the value of the depth record component.
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    Returns the value of the maybe record component.
    Returns the value of the must record component.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SRFLPState

      public SRFLPState(BitSet must, BitSet maybe, int[] cut, int depth)
      Creates an instance of a SRFLPState record class.
      Parameters:
      must - the value for the must record component
      maybe - the value for the maybe record component
      cut - the value for the cut record component
      depth - the value for the depth 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 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 boolean equals(Object obj)
      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:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • must

      public BitSet must()
      Returns the value of the must record component.
      Returns:
      the value of the must record component
    • maybe

      public BitSet maybe()
      Returns the value of the maybe record component.
      Returns:
      the value of the maybe record component
    • cut

      public int[] cut()
      Returns the value of the cut record component.
      Returns:
      the value of the cut record component
    • depth

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