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.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AStarSearcher.PathNodes<State>
A specialization ofAStarSearcher
to use a minimal implementation of hierarchical search tree nodes (with a state, accumulated cost, and pointer to a parent tree node), with the frontier implementation still exposed as a type parameter.static class
AStarSearcher.SimpleNodes<State>
A specialization ofAStarSearcher
to use a minimal implementation of unrelated search tree nodes (with a state and accumulated cost only), with the frontier implementation still exposed as a type parameter. -
Constructor Summary
Constructors Constructor Description 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.AStarSearcher(Predicate<Node> goalTest, Function<Node,Double> heuristic, Function<State,Node> initializer)
Constructor for this class which does not maintain an explored set. -
Method Summary
Methods inherited from class search.AStarFrontierSearcher
debugFrontierAddition, debugFrontierRemoval
Methods inherited from class search.GraphSearcher
debugExpansion, debugFrontier, debugFrontierExhausted, debugFrontierNonaddition, debugGoalFound, debugInitialNode, getDebug, getLastAddedToFrontier, getLastExpandedFromFrontier, getLastNotAddedToFrontier, getLastUnexpandedInFrontier, search, setDebug, solvable
-
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.
-