AI_AStar::Session Class Reference
#include <AI_AStar.h>
Detailed Description
A* session.
Session keeps temporary data needed for one pathfinding isolated from original graph. Session can also enhance original graph by additional nodes and links (can add sub-graph). Reset session then add additional nodes and links (if you whish) and then set mission of this session (start and final node).
All A* sessions must be destroyed or cleared prior to destroy or clear A* graph.
Public Member Functions | |
Session () | |
Default constructor. | |
~Session () | |
Destructor. | |
Node * | addNode (void *ptr_user_data) |
Add additional node into session. | |
Link * | addLink (Node *ptr_node1, Node *ptr_node2, float f_lenght, float f_min, float f_max) |
Add additional link into graph. | |
void | reset (AI_AStar *ptr_astar) |
Destroy all temporary graph data (without freeing alocated memory) and prepare for new data. | |
void | setMission (Node *ptr_node_start, Node *ptr_node_final) |
Set start and final point for pathfinding. | |
int | getWaySize (void) |
Get number of way nodes. | |
Node * | getWayNode (int i) |
Get way node. | |
void | setAgentWidth (float f_width) |
Set agent width. | |
void | setAStar (AI_AStar *ptr_astar) |
float | getAgentWidth (void) |
Get agent width (radius). | |
Node * | getStartNode (void) |
Get start node of the mission. | |
Node * | getFinalNode (void) |
Get final node of the mission. | |
Protected Member Functions | |
void | setNodeVisited (int i) |
Mark node as visited. | |
void | pushDirection (Node *ptr_node, float f_distance, float f_depth) |
Add explored direction. | |
void | pushSegment (Node *ptr_node1, Node *ptr_node2) |
Add explored path segment. | |
void | pushWay (Node *ptr_node) |
Add way node. | |
bool | isNodeVisited (int i) |
Test if node with this index was visited. | |
Node * | getActualNode (void) |
Get actual node while searching. | |
float | getActualDistance (void) |
Get actual distance while searching. | |
PathSegment & | getBackSegment (void) |
Get last explored segment. | |
bool | beginSearch (void) |
Begin with A* searching through given graph. | |
void | endSearch (void) |
Finish with A* searching through given graph. Make shortest way from examned path segments. | |
bool | isFinishReached (void) |
Test if we are in final node. | |
bool | moveBestDirection (void) |
Select most promissing direction and move into new node. | |
void | removeBackSegment (void) |
Remove last segment. | |
Classes | |
struct | PathDirection |
struct | PathSegment |
Constructor & Destructor Documentation
AI_AStar::Session::Session | ( | ) | [inline] |
Default constructor.
AI_AStar::Session::~Session | ( | ) | [inline] |
Destructor.
Member Function Documentation
void AI_AStar::Session::setNodeVisited | ( | int | i | ) | [inline, protected] |
Mark node as visited.
void AI_AStar::Session::pushDirection | ( | Node * | ptr_node, | |
float | f_distance, | |||
float | f_depth | |||
) | [inline, protected] |
Add explored direction.
Add explored path segment.
void AI_AStar::Session::pushWay | ( | Node * | ptr_node | ) | [inline, protected] |
Add way node.
bool AI_AStar::Session::isNodeVisited | ( | int | i | ) | [inline, protected] |
Test if node with this index was visited.
AI_AStar::Node * AI_AStar::Session::getActualNode | ( | void | ) | [inline, protected] |
Get actual node while searching.
float AI_AStar::Session::getActualDistance | ( | void | ) | [inline, protected] |
Get actual distance while searching.
AI_AStar::Session::PathSegment & AI_AStar::Session::getBackSegment | ( | void | ) | [inline, protected] |
Get last explored segment.
bool AI_AStar::Session::beginSearch | ( | void | ) | [protected] |
Begin with A* searching through given graph.
void AI_AStar::Session::endSearch | ( | void | ) | [protected] |
Finish with A* searching through given graph. Make shortest way from examned path segments.
bool AI_AStar::Session::isFinishReached | ( | void | ) | [inline, protected] |
Test if we are in final node.
bool AI_AStar::Session::moveBestDirection | ( | void | ) | [protected] |
Select most promissing direction and move into new node.
void AI_AStar::Session::removeBackSegment | ( | void | ) | [inline, protected] |
Remove last segment.
AI_AStar::Node * AI_AStar::Session::addNode | ( | void * | ptr_user_data | ) | [inline] |
Add additional node into session.
AI_AStar::Link * AI_AStar::Session::addLink | ( | Node * | ptr_node1, | |
Node * | ptr_node2, | |||
float | f_lenght, | |||
float | f_min, | |||
float | f_max | |||
) | [inline] |
Add additional link into graph.
- Parameters:
-
ptr_node1 First node of link. ptr_node2 Second node of link. f_lenght Lenght of link. f_min Minimum width of an agent that could go through this path. f_max Maximum width of an agent that could go through this path.
void AI_AStar::Session::reset | ( | AI_AStar * | ptr_astar | ) | [inline] |
Destroy all temporary graph data (without freeing alocated memory) and prepare for new data.
Set start and final point for pathfinding.
int AI_AStar::Session::getWaySize | ( | void | ) | [inline] |
Get number of way nodes.
AI_AStar::Node * AI_AStar::Session::getWayNode | ( | int | i | ) | [inline] |
Get way node.
void AI_AStar::Session::setAgentWidth | ( | float | f_width | ) | [inline] |
Set agent width.
void AI_AStar::Session::setAStar | ( | AI_AStar * | ptr_astar | ) |
float AI_AStar::Session::getAgentWidth | ( | void | ) | [inline] |
Get agent width (radius).
AI_AStar::Node * AI_AStar::Session::getStartNode | ( | void | ) | [inline] |
Get start node of the mission.
AI_AStar::Node * AI_AStar::Session::getFinalNode | ( | void | ) | [inline] |
Get final node of the mission.
The documentation for this class was generated from the following files: