Package search
Class Frontiers.PriorityQueue<Node>
java.lang.Object
search.Frontiers.DebuggingFrontier<Node>
search.Frontiers.PriorityQueue<Node>
- All Implemented Interfaces:
FrontierStructure<Node>
- Direct Known Subclasses:
Frontiers.StateKeyedPriorityQueue
- Enclosing class:
- Frontiers
public static class Frontiers.PriorityQueue<Node> extends Frontiers.DebuggingFrontier<Node>
A frontier as a priority queue, for e.g. A*.
-
Constructor Summary
Constructors Constructor Description PriorityQueue(Comparator<Node> prioritizer)
-
Method Summary
Modifier and Type Method Description void
add(Node n)
Adds a (usually newly-generated) tree node to the frontier.int
countOpen()
Returns the number of open nodes sitting unexpanded in the frontier.void
debugDisplayFrontier()
Print debugging information about the frontier.boolean
isEmpty()
Checks whether any tree nodes remain in the frontierNode
pop()
Removes one tree node from the frontier, and returns it.
-
Constructor Details
-
Method Details
-
add
Description copied from interface:FrontierStructure
Adds a (usually newly-generated) tree node to the frontier.- Parameters:
n
- The new node
-
isEmpty
public boolean isEmpty()Description copied from interface:FrontierStructure
Checks whether any tree nodes remain in the frontier- Returns:
- false when the frontier is empty, which generally indicates that the search has failed.
-
pop
Description copied from interface:FrontierStructure
Removes one tree node from the frontier, and returns it.- Returns:
- The dequeued tree node
-
countOpen
public int countOpen()Description copied from interface:FrontierStructure
Returns the number of open nodes sitting unexpanded in the frontier.- Returns:
- The number of open nodes
-
debugDisplayFrontier
public void debugDisplayFrontier()Description copied from interface:FrontierStructure
Print debugging information about the frontier. By default, does nothing.- Specified by:
debugDisplayFrontier
in interfaceFrontierStructure<Node>
- Overrides:
debugDisplayFrontier
in classFrontiers.DebuggingFrontier<Node>
-