A priority heap class used for pathfinding. The heap is static in memory and contains graph.Size PathNodeHelper objects.
More...
List of all members.
Public Member Functions |
| PathGraphPriorityHeap (PathGraph graph) |
| Constructor.
|
| PathGraphPriorityHeap (PathGraph graph, int maxHeapSize) |
| Constructor.
|
void | Reset () |
| Reset the count of elements to 0. This can be used to reset the heap without the cost of reallocating it. Note that this does not clear out memory associated with attached nodes.
|
void | Add (PathNodeHelper helper) |
| Add a node to the heap.
|
PathNodeHelper | Remove (int index) |
| Remove a node from the heap.
|
void | Fix (int index) |
| Fixes the ordering of the heap item at the specified index.
|
PathNodeHelper | Item (int index) |
| Retrieves the PathNodeHelper at the specified index.
|
Properties |
int | Size [get] |
| The size of the allocated array, equal to max graph size representable.
|
int | Count [get] |
| The number of heap elements.
|
Detailed Description
A priority heap class used for pathfinding. The heap is static in memory and contains graph.Size PathNodeHelper objects.
Constructor & Destructor Documentation
RAIN.Path.PathGraphPriorityHeap.PathGraphPriorityHeap |
( |
PathGraph |
graph | ) |
|
Constructor.
- Parameters:
-
graph | The graph on which the priority heap will operate. The heap is limited to the size of the graph at the time it is passed in. |
RAIN.Path.PathGraphPriorityHeap.PathGraphPriorityHeap |
( |
PathGraph |
graph, |
|
|
int |
maxHeapSize |
|
) |
| |
Constructor.
- Parameters:
-
graph | The graph on which the priority heap will operate. The heap is limited to the size of the graph at the time it is passed in. |
maxHeapSize | A maximum heap size for the graph. This is to limit memory usage for very large graphs. |
Member Function Documentation
Add a node to the heap.
- Parameters:
-
void RAIN.Path.PathGraphPriorityHeap.Fix |
( |
int |
index | ) |
|
Fixes the ordering of the heap item at the specified index.
- Parameters:
-
index | Index of the item to fix |
Remove a node from the heap.
- Parameters:
-
index | The index of the item to remove |
- Returns:
- Returns the PathNodeHelper that was removed.
void RAIN.Path.PathGraphPriorityHeap.Reset |
( |
| ) |
|
Reset the count of elements to 0. This can be used to reset the heap without the cost of reallocating it. Note that this does not clear out memory associated with attached nodes.
Property Documentation
int RAIN.Path.PathGraphPriorityHeap.Count [get] |
The number of heap elements.
int RAIN.Path.PathGraphPriorityHeap.Size [get] |
The size of the allocated array, equal to max graph size representable.