Interface INodeTraverser<T>
Provide an alternate traverser for a graph that any of the solvers in PathFinder.Solvers.Generic may use instead of the default traverser.
Namespace: PathFinder.Graphs
Assembly: PathFinder.dll
Syntax
public interface INodeTraverser<T>
where T : IEquatable<T>
Type Parameters
Name | Description |
---|---|
T |
Remarks
A use case to create a separate Node Traverser may be to provide alternate map traversal patterns for different types of entities in a game or simulation.
Methods
| Improve this Doc View SourceEstimatedCost(T, T)
Calculate the estimated cost to another node.
Declaration
double EstimatedCost(T fromNode, T toNode)
Parameters
Type | Name | Description |
---|---|---|
T | fromNode | The node to move from. |
T | toNode | The node to move to. |
Returns
Type | Description |
---|---|
System.Double | The estimated cost to move to the toNode starting at the fromNode |
Remarks
In order for the AStar to work as expected, this should always return the "best case" cost.
NeighborNodes(T)
Get nodes that are neighbors of (immediately traversable to) sourceNode.
Declaration
IEnumerable<T> NeighborNodes(T sourceNode)
Parameters
Type | Name | Description |
---|---|---|
T | sourceNode |
Returns
Type | Description |
---|---|
IEnumerable<T> |
RealCost(T, T)
Calculate the real cost to another node.
Declaration
double RealCost(T fromNode, T toNode)
Parameters
Type | Name | Description |
---|---|---|
T | fromNode | The node to move from. |
T | toNode | The node to move to. |
Returns
Type | Description |
---|---|
System.Double | The actual cost to move from one node to another. |
Remarks
Should return less than 0 if not possible to move to node.