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.

@FunctionalInterface public interface AstarStopCriterion extends StopCriterion
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 Type
    Method
    Description
    minValidChildrenPercent(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 boolean
    boolean
    Evaluates this criterion against the given A* search statistics.

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Method Details

    • minValidChildrenPercent

      static AstarStopCriterion minValidChildrenPercent(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.
      Parameters:
      minPercent - the minimum required percentage of valid children to continue
      Returns:
      an AstarStopCriterion for minimum valid children percentage
    • testAstarStats

      boolean testAstarStats(AstarStats stats)
      Evaluates this criterion against the given A* search statistics.
      Parameters:
      stats - the A* search statistics
      Returns:
      true if the search should be terminated, false otherwise
    • test

      default boolean test(SearchStatistics stats)
      Specified by:
      test in interface Predicate<SearchStatistics>
      Throws:
      IllegalArgumentException - if the provided statistics are not an instance of AstarStats