Package search

Class AStarSearcher<State,​Node extends SearchTreeNode<Node,​State> & KnowsOwnCost>

java.lang.Object
search.GraphSearcher<State,​Node,​Frontier>
search.PriorityQueueSearcher<State,​Node,​Frontier>
search.AStarFrontierSearcher<State,​Node,​Frontiers.PriorityQueue<Node>>
search.AStarSearcher<State,​Node>
Type Parameters:
State - Type representing elements of the search space.
Node - Type representing nodes in the search tree. Each node typically contains a reference to a State element.
Direct Known Subclasses:
AStarSearcher.PathNodes, AStarSearcher.SimpleNodes, MovesFinder

public class AStarSearcher<State,​Node extends SearchTreeNode<Node,​State> & KnowsOwnCost>
extends AStarFrontierSearcher<State,​Node,​Frontiers.PriorityQueue<Node>>
Extension of AStarFrontierSearcher to fix the frontier structure with a minimal priority queue implementation.
  • Constructor Details

    • AStarSearcher

      public AStarSearcher​(Predicate<Node> goalTest, Function<Node,​Double> heuristic, Function<State,​Node> initializer)
      Constructor for this class which does not maintain an explored set.
      Parameters:
      goalTest - A boolean-returning function checking whether a tree node contains a goal state.
      heuristic - Heuristic function for this search application.
      initializer - Creates an initial tree node from a search space element. Passed as-is to the primary constructor for this class, and thence to superclasses.
    • AStarSearcher

      public AStarSearcher​(Predicate<Node> goalTest, Function<Node,​Double> heuristic, Function<Frontiers.PriorityQueue<Node>,​ExploredSet<Node>> exploredSetFactory, Function<State,​Node> initializer)
      Primary constructor for this class; other constructor relay to this one. This constructor provides the basic priority queue implementation of the frontier to the superclass constructor.
      Parameters:
      goalTest - A boolean-returning function checking whether a tree node contains a goal state.
      heuristic - Heuristic function for this search application.
      exploredSetFactory - Structure used to manage adding elements to the frontier, in particular for avoiing duplication. Passed as-is to the primary constructor for this class, and thence to the parent constructor.
      initializer - Creates an initial tree node from a search space element. Passed as-is to the primary constructor for this class, and thence to the parent constructor.