Record Class SearchAlgorithm.Limits

java.lang.Object
java.lang.Record
algorithm.SearchAlgorithm.Limits
Record Components:
limitEvaluations - Whether to limit the number of evaluations of the run.
maxEvaluations - The maximum number of evaluations made during the run. After exceeding this amount, the search is terminated early.
limitExpansions - Whether to limit the number of expansions of the run.
maxExpansions - The maximum number of expansions made during the run. After exceeding this amount, the search is terminated early.
limitMaxNodes - Whether to limit the number of nodes stored in memory during the run.
maxNodes - The maximum number of nodes stored in memory during the run. This is akin to the available memory of the search. Although the number of nodes stored does not directly correspond 1-to-1 with memory usage, it is the main memory usage of most best-first algorithms.
Enclosing interface:
SearchAlgorithm

public static record SearchAlgorithm.Limits(boolean limitEvaluations, long maxEvaluations, boolean limitExpansions, long maxExpansions, boolean limitMaxNodes, long maxNodes) extends Record
The limits imposed on the search. This is used by B*-squared and by all algorithm variants for the implementation of the core experiments and its computational and spatial limits.
  • Field Details

  • Constructor Details

    • Limits

      public Limits(boolean limitEvaluations, long maxEvaluations, boolean limitExpansions, long maxExpansions, boolean limitMaxNodes, long maxNodes)
      Creates an instance of a Limits record class.
      Parameters:
      limitEvaluations - the value for the limitEvaluations record component
      maxEvaluations - the value for the maxEvaluations record component
      limitExpansions - the value for the limitExpansions record component
      maxExpansions - the value for the maxExpansions record component
      limitMaxNodes - the value for the limitMaxNodes record component
      maxNodes - the value for the maxNodes record component
  • Method Details

    • reached

      public boolean reached(MetricKeeper metrics)
    • reachedEvaluations

      public boolean reachedEvaluations(MetricKeeper metrics)
    • reachedExpansions

      public boolean reachedExpansions(MetricKeeper metrics)
    • reachedNodes

      public boolean reachedNodes(MetricKeeper metrics)
    • reachedAny

      public boolean reachedAny(MetricKeeper... metrics)
    • reachedAll

      public boolean reachedAll(MetricKeeper... metrics)
    • reachedSum

      public boolean reachedSum(MetricKeeper... metrics)
    • of

      public static SearchAlgorithm.Limits of(long maxEvaluations, long maxExpansions, long maxNodes)
    • memoryLimit

      public static SearchAlgorithm.Limits memoryLimit(long maxNodes)
    • combine

    • 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 the compare method from their corresponding wrapper classes.
      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.
    • limitEvaluations

      public boolean limitEvaluations()
      Returns the value of the limitEvaluations record component.
      Returns:
      the value of the limitEvaluations record component
    • maxEvaluations

      public long maxEvaluations()
      Returns the value of the maxEvaluations record component.
      Returns:
      the value of the maxEvaluations record component
    • limitExpansions

      public boolean limitExpansions()
      Returns the value of the limitExpansions record component.
      Returns:
      the value of the limitExpansions record component
    • maxExpansions

      public long maxExpansions()
      Returns the value of the maxExpansions record component.
      Returns:
      the value of the maxExpansions record component
    • limitMaxNodes

      public boolean limitMaxNodes()
      Returns the value of the limitMaxNodes record component.
      Returns:
      the value of the limitMaxNodes record component
    • maxNodes

      public long maxNodes()
      Returns the value of the maxNodes record component.
      Returns:
      the value of the maxNodes record component