#include <AStarSearch.h>
Public Member Functions | |
AStarSearch (long minCacheSize, long maxTreeSize, P parameterSet) | |
N | search (const N &start, const N &goal, const P ¶meterSet, U &pathLength) |
Private Member Functions | |
unsigned int | findIndexOfNextNode () |
int | testNewNodesAgainstGoal (unsigned int firstNode, unsigned int lastNode, const N &goal) |
N | backtraceNode (unsigned int indexOfBestNode, U &pathLength) |
void | draw (unsigned int indexOfBestNode) |
Private Attributes | |
std::vector< N > | searchTree |
std::vector< unsigned int > | expandedNodes |
long | maxTreeSize |
P | parameterSet |
Definition at line 241 of file AStarSearch.h.
AStarSearch< N, P, U >::AStarSearch | ( | long | minCacheSize, | |
long | maxTreeSize, | |||
P | parameterSet | |||
) | [inline] |
Constructor
minCacheSize | The number of nodes to allocate memory for | |
maxTreeSize | The maximum number of nodes to expand | |
parameterSet | A parameter set to check the maximum number of nodes to expand |
Definition at line 249 of file AStarSearch.h.
References AStarSearch< N, P, U >::expandedNodes, and AStarSearch< N, P, U >::searchTree.
N AStarSearch< N, P, U >::backtraceNode | ( | unsigned int | indexOfBestNode, | |
U & | pathLength | |||
) | [inline, private] |
Backtraces the best node found to the first node after the start node
indexOfBestNode | The index of the best node found | |
pathLength | Returns the length of the backtraced path |
Definition at line 379 of file AStarSearch.h.
References AStarSearch< N, P, U >::searchTree.
Referenced by AStarSearch< N, P, U >::search().
void AStarSearch< N, P, U >::draw | ( | unsigned int | indexOfBestNode | ) | [inline, private] |
Draw all expanded paths and the selected path on the RobotControl field view
indexOfBestNode | The index of the last expanded node |
Definition at line 395 of file AStarSearch.h.
References LARGE_DOT, LINE, AStarSearch< N, P, U >::parameterSet, PfPose::pos, Drawings::ps_solid, Drawings::red, AStarSearch< N, P, U >::searchTree, PfVec::x, PfVec::y, and Drawings::yellow.
Referenced by AStarSearch< N, P, U >::search().
unsigned int AStarSearch< N, P, U >::findIndexOfNextNode | ( | ) | [inline, private] |
Finds the next node to be expanded
Definition at line 333 of file AStarSearch.h.
References AStarSearch< N, P, U >::searchTree.
Referenced by AStarSearch< N, P, U >::search().
N AStarSearch< N, P, U >::search | ( | const N & | start, | |
const N & | goal, | |||
const P & | parameterSet, | |||
U & | pathLength | |||
) | [inline] |
The main search function
start | The starting node | |
goal | The goal node | |
parameterSet | The current parameter set | |
pathLength | Returns the length of the path to the goal |
Definition at line 274 of file AStarSearch.h.
References AStarSearch< N, P, U >::backtraceNode(), COMPLEX_DRAWING, DEBUG_DRAWING_FINISHED, AStarSearch< N, P, U >::draw(), AStarSearch< N, P, U >::expandedNodes, AStarSearch< N, P, U >::findIndexOfNextNode(), int(), AStarSearch< N, P, U >::maxTreeSize, AStarSearch< N, P, U >::searchTree, and AStarSearch< N, P, U >::testNewNodesAgainstGoal().
Referenced by Motionfield::getFieldVecFromAStarSearch().
int AStarSearch< N, P, U >::testNewNodesAgainstGoal | ( | unsigned int | firstNode, | |
unsigned int | lastNode, | |||
const N & | goal | |||
) | [inline, private] |
Tests if any node has reached the goal
firstNode | The first node to test | |
lastNode | The last node to test | |
goal | The goal to test against |
Definition at line 360 of file AStarSearch.h.
References AStarSearch< N, P, U >::parameterSet, and AStarSearch< N, P, U >::searchTree.
Referenced by AStarSearch< N, P, U >::search().
std::vector<unsigned int> AStarSearch< N, P, U >::expandedNodes [private] |
Indizes of all expanded nodes
Definition at line 323 of file AStarSearch.h.
Referenced by AStarSearch< N, P, U >::AStarSearch(), and AStarSearch< N, P, U >::search().
long AStarSearch< N, P, U >::maxTreeSize [private] |
The maximum number of nodes to expand
Definition at line 325 of file AStarSearch.h.
Referenced by AStarSearch< N, P, U >::search().
P AStarSearch< N, P, U >::parameterSet [private] |
The parameter set
Definition at line 327 of file AStarSearch.h.
Referenced by AStarSearch< N, P, U >::draw(), and AStarSearch< N, P, U >::testNewNodesAgainstGoal().
std::vector<N> AStarSearch< N, P, U >::searchTree [private] |
A container for all nodes
Definition at line 321 of file AStarSearch.h.
Referenced by AStarSearch< N, P, U >::AStarSearch(), AStarSearch< N, P, U >::backtraceNode(), AStarSearch< N, P, U >::draw(), AStarSearch< N, P, U >::findIndexOfNextNode(), AStarSearch< N, P, U >::search(), and AStarSearch< N, P, U >::testNewNodesAgainstGoal().