Interface AstarStopCriterion
- All Superinterfaces:
Predicate<SearchStatistics>,StopCriterion
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface representing a stop criterion specifically for A* search variants.
This extends StopCriterion to provide access to A*-specific statistics such as the
valid children percentage.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AstarStopCriterionminValidChildrenPercent(double minPercent) Creates a stop criterion that terminates the search when the smoothed percentage of valid children falls below or equal to a specified threshold.default booleantest(SearchStatistics stats) booleantestAstarStats(AstarStats stats) Evaluates this criterion against the given A* search statistics.
-
Method Details
-
minValidChildrenPercent
Creates a stop criterion that terminates the search when the smoothed percentage of valid children falls below or equal to a specified threshold.- Parameters:
minPercent- the minimum required percentage of valid children to continue- Returns:
- an AstarStopCriterion for minimum valid children percentage
-
testAstarStats
Evaluates this criterion against the given A* search statistics.- Parameters:
stats- the A* search statistics- Returns:
trueif the search should be terminated,falseotherwise
-
test
- Specified by:
testin interfacePredicate<SearchStatistics>- Throws:
IllegalArgumentException- if the provided statistics are not an instance ofAstarStats
-