RAIN.Path.PathGraphPriorityHeap Class Reference

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:
graphThe 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:
graphThe 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.
maxHeapSizeA maximum heap size for the graph. This is to limit memory usage for very large graphs.

Member Function Documentation

void RAIN.Path.PathGraphPriorityHeap.Add ( PathNodeHelper  helper)

Add a node to the heap.

Parameters:
helperThe PathNodeHelper to add
void RAIN.Path.PathGraphPriorityHeap.Fix ( int  index)

Fixes the ordering of the heap item at the specified index.

Parameters:
indexIndex of the item to fix
PathNodeHelper RAIN.Path.PathGraphPriorityHeap.Item ( int  index)

Retrieves the PathNodeHelper at the specified index.

Parameters:
indexIndex of the PathNodeHelper to retrieve
Returns:
The PathNodeHelper at the specified index
PathNodeHelper RAIN.Path.PathGraphPriorityHeap.Remove ( int  index)

Remove a node from the heap.

Parameters:
indexThe 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.