public class PrioritizedSearchNode extends SearchNode
SearchNode
class that includes
a priority value. Priority is used to represent the "f" function, which in A* is defined to be the sum of the
cost to the node and the admissible heuristic from it. The priority is use to order nodes for expansion.Modifier and Type | Class and Description |
---|---|
static class |
PrioritizedSearchNode.PSNComparator
A class for comparing the priority of two PrioritizedSearchNodes.
|
Modifier and Type | Field and Description |
---|---|
double |
priority
The priority of the node used to order it for expansion.
|
backPointer, generatingAction, s
Constructor and Description |
---|
PrioritizedSearchNode(HashableState s,
Action ga,
SearchNode bp,
double p)
Constructs a SearchNode for the input state and priority and sets the generating action and back pointer to the provided elements.
|
PrioritizedSearchNode(HashableState s,
double p)
Initializes a PrioritizedSearchNode for a given (hashed) input state and priority value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
void |
setAuxInfoTo(PrioritizedSearchNode o)
This method rewires the generating node information and priority to that specified in a different PrioritizedSearchNode.
|
public double priority
public PrioritizedSearchNode(HashableState s, double p)
s
- the hashed input state this node represents.p
- the priority of this node.public PrioritizedSearchNode(HashableState s, Action ga, SearchNode bp, double p)
s
- the hashed input state this node will represent.ga
- the action that was used to generate sbp
- the search node that contains the previous state from which s was generated.p
- the priority of the node.public void setAuxInfoTo(PrioritizedSearchNode o)
o
- the other PrioritizedSearchNode whose generating information and priority should be used.public boolean equals(java.lang.Object o)
equals
in class SearchNode
public int hashCode()
hashCode
in class SearchNode