Node class

Versione italiana
Implement data do manage the nodes for the A* algorithm.

Inherit: IComparable<T>, IEquatable<T>

Properties

Name Type Description
NodeGuid Guid Unique identifier of the node
Parent Node Actaul node parent Node object
G_CurrentCost Integer Current node cost (movement cost + parent current cost)
H_HeuristicDistance Integer Heuristic distance from the destination
F_PathScore Integer Current path cost (current cost + heuristic distance)
Item Object Generic object bound to the node

Methods

Name Parameters type Return type Description
CompareTo Node Integer Compare this istance with another one first by path score then by current cost
Equals Node Boolean Verify if the istance is equal to another one comparing the identifers

Constructors

Name Paramaters types Description
Node(Node, int, int) Node, Integer, Integer Create a new Node instance
Node(Guid, Node, int, int) Guid, Node, Integer, Integer Create a new Node instance with a given identifier

Remarks

When creating a new Node istance the parent node, movement cost and heuristic distance must always be passed.
Only in the starting or ending node the parent node can be null and the cost and heuristic distance set to 0.

Last edited Jul 28, 2010 at 12:41 PM by Arconte, version 14

Comments

No comments yet.