IMS2  Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
PathFinding Class Reference

Static Public Member Functions

static bool BreadthFirst (SimplePathNode *origin, SimplePathNode *target, stack< int > &OUT_path)
 A breath-first solution that finds the guaranteed shortest path in terms of nodes covered. More...
 

Detailed Description

Class containing algorithms for pathfinding or related tasks

Member Function Documentation

bool PathFinding::BreadthFirst ( SimplePathNode origin,
SimplePathNode target,
stack< int > &  OUT_path 
)
static

A breath-first solution that finds the guaranteed shortest path in terms of nodes covered.

Meaning, the path from origin to target that has the fewest nodes in it, ignoring all other costs.

Parameters
originThe node to start at
targetThe node to find a path to
OUT_pathWill contain the path from origin to target if the function was successful. Old contents will be overwritten!
Note
OUT_path will only contain the ids, not the elements itself. The stack will be empty if no path was found.
Returns
False if no path exists, true otherwise
Note
In case origin and target are the same node, the algorithm will search for a loopback path and return the shortest path leading from the origin node to itself, instead of not searching for a path at all. Since paths between nodes must not necessarily be traversible in both directions, this is more useful than it sounds.

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