Class Node<V>
java.lang.Object
com.github.tommyettinger.ds.BinaryHeap.Node
com.github.yellowstonegames.path.Node<V>
- Type Parameters:
V- the vertex type; oftenCoord
public class Node<V>
extends com.github.tommyettinger.ds.BinaryHeap.Node
An extended version of
BinaryHeap.Node that also stores a reference to the parent Graph,
a vertex object of type V, a Map of neighbor Nodes to the appropriate Connection per Node, an extra
List of those same Connections for faster iteration, and a lot of internal data used by algorithms in this package.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatInternal; confirmed distance so far to get to this Node from the start.protected floatInternal; estimated distance to get from this Node to the goal.protected intInternal; a utility field used to store depth in some algorithms.protected com.github.tommyettinger.ds.ObjectList<Connection<V>> protected intInternal; a utility field used to distinguish which algorithm last used this Node.protected com.github.tommyettinger.ds.ObjectObjectMap<Node<V>, Connection<V>> protected final Vprotected com.github.tommyettinger.ds.ObjectList<Connection<V>> Internal; a reference to the previous Node in a BinaryHeap.protected booleanInternal; tracking bit for whether this Node has been checked during the current algorithm.protected booleanInternal; tracking bit for whether this Node has already been visited during the current algorithm.Fields inherited from class com.github.tommyettinger.ds.BinaryHeap.Node
index, value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Connection<V> protected voidbooleancom.github.tommyettinger.ds.ObjectList<Connection<V>> protected Connection<V> inthashCode()protected Connection<V> removeEdge(Node<V> v) protected booleanresetAlgorithmAttributes(int runID) toString()Methods inherited from class com.github.tommyettinger.ds.BinaryHeap.Node
getValue
-
Field Details
-
graph
-
object
-
neighbors
-
outEdges
-
inEdges
-
visited
protected boolean visitedInternal; tracking bit for whether this Node has already been visited during the current algorithm. -
seen
protected boolean seenInternal; tracking bit for whether this Node has been checked during the current algorithm. -
distance
protected float distanceInternal; confirmed distance so far to get to this Node from the start. -
estimate
protected float estimateInternal; estimated distance to get from this Node to the goal. -
prev
-
i
protected int iInternal; a utility field used to store depth in some algorithms. -
lastRunID
protected int lastRunIDInternal; a utility field used to distinguish which algorithm last used this Node.
-
-
Constructor Details
-
Node
-
-
Method Details
-
getEdge
-
addEdge
-
removeEdge
-
disconnect
protected void disconnect() -
getConnections
-
getObject
-
resetAlgorithmAttributes
protected boolean resetAlgorithmAttributes(int runID) IfrunIDis not equal tolastRunID, this resets the internal fieldsvisited,seen,distance,estimate,prev, andi, then setslastRunIDtorunID.- Parameters:
runID- an int that identifies which run of an algorithm is currently active- Returns:
- true if anything was reset, or false if
runIDis equal tolastRunID
-
equals
-
hashCode
-
toString
- Overrides:
toStringin classcom.github.tommyettinger.ds.BinaryHeap.Node
-