Record Class ExternalAlgorithmHaltingConditions

java.lang.Object
java.lang.Record
fr.inria.rules.integraal.component_builder.externalHaltingConditions.ExternalAlgorithmHaltingConditions
Record Components:
rank - the maximum depth of the reasoning level (e.g., for chase or rewriting, the max number of breadth-first reasoning steps). Defaults to a fixed value if null.
timeout - the maximum duration before the algorithm is forcibly stopped. Defaults to a fixed value if null.

public record ExternalAlgorithmHaltingConditions(Integer rank, Duration timeout) extends Record
Defines conditions that must be respected in case of a non-terminating algorithm.
  • Constructor Details

    • ExternalAlgorithmHaltingConditions

      public ExternalAlgorithmHaltingConditions(Integer rank, Duration timeout)
      Custom constructor with default handling
      Parameters:
      rank - the requested rank, or null to use the default one
      timeout - the requested timeout, or null to use the default one
    • ExternalAlgorithmHaltingConditions

      public ExternalAlgorithmHaltingConditions(List<ExternalHaltingCondition> conditions)
      Custom constructor which handles a list of external handling conditions
      Parameters:
      conditions - the external halting conditions to extract values from
    • ExternalAlgorithmHaltingConditions

      public ExternalAlgorithmHaltingConditions(ExternalHaltingCondition[] conds)
      Custom constructor which handles an array of external handling conditions
      Parameters:
      conds - the external halting conditions to extract values from
  • Method Details

    • withModified

      public ExternalAlgorithmHaltingConditions withModified(Integer newRank, Duration newTimeout)
      Returns a new instance of ExternalAlgorithmHaltingConditions with optional modifications.
      Parameters:
      newRank - the new rank to set, or null to keep the existing rank.
      newTimeout - the new timeout to set, or null to keep the existing timeout.
      Returns:
      a new ExternalAlgorithmHaltingConditions instance with the modified values.
    • defaultConditions

      public static ExternalAlgorithmHaltingConditions defaultConditions()
      Returns the default ExternalAlgorithmHaltingConditions instance with default rank and timeout values.
      Returns:
      a default instance of ExternalAlgorithmHaltingConditions.
    • 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. 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.
    • rank

      public Integer rank()
      Returns the value of the rank record component.
      Returns:
      the value of the rank record component
    • timeout

      public Duration timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component