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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLimits(boolean limitEvaluations, long maxEvaluations, boolean limitExpansions, long maxExpansions, boolean limitMaxNodes, long maxNodes) Creates an instance of aLimitsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncombine(SearchAlgorithm.Limits other) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thelimitEvaluationsrecord component.booleanReturns the value of thelimitExpansionsrecord component.booleanReturns the value of thelimitMaxNodesrecord component.longReturns the value of themaxEvaluationsrecord component.longReturns the value of themaxExpansionsrecord component.longmaxNodes()Returns the value of themaxNodesrecord component.static SearchAlgorithm.LimitsmemoryLimit(long maxNodes) static SearchAlgorithm.Limitsof(long maxEvaluations, long maxExpansions, long maxNodes) booleanreached(MetricKeeper metrics) booleanreachedAll(MetricKeeper... metrics) booleanreachedAny(MetricKeeper... metrics) booleanreachedEvaluations(MetricKeeper metrics) booleanreachedExpansions(MetricKeeper metrics) booleanreachedNodes(MetricKeeper metrics) booleanreachedSum(MetricKeeper... metrics) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
-
-
Constructor Details
-
Limits
public Limits(boolean limitEvaluations, long maxEvaluations, boolean limitExpansions, long maxExpansions, boolean limitMaxNodes, long maxNodes) Creates an instance of aLimitsrecord class.- Parameters:
limitEvaluations- the value for thelimitEvaluationsrecord componentmaxEvaluations- the value for themaxEvaluationsrecord componentlimitExpansions- the value for thelimitExpansionsrecord componentmaxExpansions- the value for themaxExpansionsrecord componentlimitMaxNodes- the value for thelimitMaxNodesrecord componentmaxNodes- the value for themaxNodesrecord component
-
-
Method Details
-
reached
-
reachedEvaluations
-
reachedExpansions
-
reachedNodes
-
reachedAny
-
reachedAll
-
reachedSum
-
of
-
memoryLimit
-
combine
-
toString
-
hashCode
-
equals
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 thecomparemethod from their corresponding wrapper classes. -
limitEvaluations
public boolean limitEvaluations()Returns the value of thelimitEvaluationsrecord component.- Returns:
- the value of the
limitEvaluationsrecord component
-
maxEvaluations
public long maxEvaluations()Returns the value of themaxEvaluationsrecord component.- Returns:
- the value of the
maxEvaluationsrecord component
-
limitExpansions
public boolean limitExpansions()Returns the value of thelimitExpansionsrecord component.- Returns:
- the value of the
limitExpansionsrecord component
-
maxExpansions
public long maxExpansions()Returns the value of themaxExpansionsrecord component.- Returns:
- the value of the
maxExpansionsrecord component
-
limitMaxNodes
public boolean limitMaxNodes()Returns the value of thelimitMaxNodesrecord component.- Returns:
- the value of the
limitMaxNodesrecord component
-
maxNodes
-