Record Class AllocationSpec

java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.AllocationSpec
Record Components:
lo - the lower bound of the per-row allocation variable; must be finite and ≤ hi
hi - the upper bound of the per-row allocation variable; must be finite and ≥ lo
columnName - the name to give the new allocation column in the output schema; must not be blank

public record AllocationSpec(double lo, double hi, String columnName) extends Record
Specifies the continuous LP (linear-programming) allocation mode for the OPTIMIZE ALLOCATE operator.

Each candidate row is assigned a continuous decision variable in the closed interval [lo, hi]. The solver chooses a value for each row that optimises the objective while satisfying the constraints; the chosen value is emitted in a new output column named columnName (output schema = input schema + 1 column).

Contrast with the default binary MIP mode, where each row's variable is {0, 1} (in or out) and the output schema is unchanged (chosen rows are emitted verbatim).

  • Constructor Summary

    Constructors
    Constructor
    Description
    AllocationSpec(double lo, double hi, String columnName)
    Creates an instance of a AllocationSpec record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the columnName record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    hi()
    Returns the value of the hi record component.
    double
    lo()
    Returns the value of the lo record component.
    final String
    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

    • AllocationSpec

      public AllocationSpec(double lo, double hi, String columnName)
      Creates an instance of a AllocationSpec record class.
      Parameters:
      lo - the value for the lo record component
      hi - the value for the hi record component
      columnName - the value for the columnName record component
  • Method Details

    • toString

      public final 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.
    • lo

      public double lo()
      Returns the value of the lo record component.
      Returns:
      the value of the lo record component
    • hi

      public double hi()
      Returns the value of the hi record component.
      Returns:
      the value of the hi record component
    • columnName

      public String columnName()
      Returns the value of the columnName record component.
      Returns:
      the value of the columnName record component