A* Pathfinding Project  4.1.9
The A* Pathfinding Project for Unity 3D
CooperativePathHandler Class Reference

Handles thread specific path data for cooperative pathfinding. More...

Detailed Description

Handles thread specific path data for cooperative pathfinding.

See also
#PathNodeCooperative

Public Member Functions

 CooperativePathHandler (int threadID, int totalThreadCount, int temporalDepth)
 
override void DestroyNode (GraphNode node)
 Internal method to clean up node data. More...
 
override void GetAllPathNodes (GraphNode node, System.Action< PathNode > action)
 Calls a delegate with all path nodes associated with the specified node. More...
 
override PathNode GetPathNode (int nodeIndex)
 Path node associated with the specified node. More...
 
override PathNode GetPathNode (GraphNode node)
 Returns the PathNode corresponding to the specified node. More...
 
PathNode GetPathNode (int nodeIndex, int t)
 
PathNode GetPathNode (GraphNode node, int t)
 
override void InitializeNode (GraphNode node)
 Internal method to initialize node data. More...
 
- Public Member Functions inherited from PathHandler
 PathHandler (int threadID, int totalThreadCount)
 
void ClearPathIDs ()
 Set all nodes' pathIDs to 0. More...
 
void InitializeForPath (Path p)
 

Public Attributes

readonly int temporalDepth = 30
 Maximum number of time steps to be used in path planning. More...
 
- Public Attributes inherited from PathHandler
readonly System.Text.StringBuilder DebugStringBuilder = new System.Text.StringBuilder()
 StringBuilder that paths can use to build debug strings. More...
 
readonly BinaryHeap heap = new BinaryHeap(128)
 Binary heap to keep track of nodes on the "Open list". More...
 
PathNode [] nodes = new PathNode[0]
 Array of all PathNodes. More...
 
readonly int threadID
 
readonly int totalThreadCount
 

Additional Inherited Members

- Properties inherited from PathHandler
ushort PathID [get, private set]
 ID for the path currently being calculated or last path that was calculated. More...
 

Constructor & Destructor Documentation

◆ CooperativePathHandler()

CooperativePathHandler ( int  threadID,
int  totalThreadCount,
int  temporalDepth 
)

Member Function Documentation

◆ DestroyNode()

override void DestroyNode ( GraphNode  node)
virtual

Internal method to clean up node data.

Reimplemented from PathHandler.

◆ GetAllPathNodes()

override void GetAllPathNodes ( GraphNode  node,
System.Action< PathNode action 
)
virtual

Calls a delegate with all path nodes associated with the specified node.

The default path handler only has one PathNode per GraphNode, but other path handlers may have more (e.g the CooperativePathHandler)

Reimplemented from PathHandler.

◆ GetPathNode() [1/4]

override PathNode GetPathNode ( int  nodeIndex)
virtual

Path node associated with the specified node.

The default path handler only has one PathNode per GraphNode, but other path handlers may have more (e.g the CooperativePathHandler).

The PathNode is specific to this PathHandler since multiple PathHandlers are used at the same time if multithreading is enabled.

See also
GetAllPathNodes

Reimplemented from PathHandler.

◆ GetPathNode() [2/4]

override PathNode GetPathNode ( GraphNode  node)
virtual

Returns the PathNode corresponding to the specified node.

The PathNode is specific to this PathHandler since multiple PathHandlers are used at the same time if multithreading is enabled.

Reimplemented from PathHandler.

◆ GetPathNode() [3/4]

PathNode GetPathNode ( int  nodeIndex,
int  t 
)

◆ GetPathNode() [4/4]

PathNode GetPathNode ( GraphNode  node,
int  t 
)

◆ InitializeNode()

override void InitializeNode ( GraphNode  node)
virtual

Internal method to initialize node data.

Reimplemented from PathHandler.

Member Data Documentation

◆ temporalDepth

readonly int temporalDepth = 30

Maximum number of time steps to be used in path planning.

A higher number increases both memory usage and the time to calculate a path. The memory usage increases linearly so a temporal depth of 20 will use roughly twice as much memory as a temporal depth of 10.

See also
Pathfinding.CooperativeContext.temporalDepth

The documentation for this class was generated from the following file: