#include <LinkAStar.hxx>
Public Member Functions | |
LinkAStar (const LinkMatrix &linkMatrix) | |
~LinkAStar () | |
bool | computePath (LNode from, LNode to) |
LNodePath | givePath () |
bool | isAlreadyInList (std::pair< int, int > n, const LNodeMap &aList) |
void | addNeighbours (std::pair< int, int > n) |
std::pair< int, int > | bestNode (const LNodeMap &aList) |
void | moveToClosedList (std::pair< int, int > n) |
double | distance (int i1, int j1, int i2, int j2) |
Protected Attributes | |
const LinkMatrix & | _linkMatrix |
LNodeMap | _closedList |
LNodeMap | _openList |
LNode | _from |
LNode | _to |
std::priority_queue< Cost > | _pq |
Definition at line 68 of file LinkAStar.hxx.
LinkAStar::LinkAStar | ( | const LinkMatrix & | linkMatrix | ) |
LinkAStar::~LinkAStar | ( | ) |
Definition at line 54 of file LinkAStar.cxx.
void LinkAStar::addNeighbours | ( | std::pair< int, int > | n | ) |
Definition at line 118 of file LinkAStar.cxx.
References _closedList, _linkMatrix, _openList, _pq, _to, YACS::HMI::LinkMatrix::cost(), distance(), YACS::HMI::LCostNode::getFCost(), YACS::HMI::LCostNode::getGCost(), YACS::HMI::LCostNode::getHCost(), YACS::HMI::LNode::getX(), YACS::HMI::LNode::getY(), CORBAEngineTest::i, YACS::HMI::LinkMatrix::imax(), isAlreadyInList(), YACS::HMI::LinkMatrix::jmax(), YACS::HMI::LCostNode::setFCost(), YACS::HMI::LCostNode::setGCost(), and YACS::HMI::LCostNode::setHCost().
Referenced by computePath().
std::pair< int, int > LinkAStar::bestNode | ( | const LNodeMap & | aList | ) |
Definition at line 58 of file LinkAStar.cxx.
References _closedList, _from, _openList, _pq, _to, addNeighbours(), bestNode(), DEBTRACE, YACS::HMI::LNode::getPos(), YACS::HMI::LNode::getX(), YACS::HMI::LNode::getY(), and moveToClosedList().
Referenced by YACS::HMI::SceneComposedNodeItem::rebuildLinks().
|
inline |
Definition at line 83 of file LinkAStar.hxx.
Referenced by addNeighbours().
LNodePath LinkAStar::givePath | ( | ) |
Definition at line 91 of file LinkAStar.cxx.
References _closedList, _from, _to, DEBTRACE, YACS::HMI::LNode::getPos(), YACS::HMI::LNode::getX(), YACS::HMI::LNode::getY(), and YACS::HMI::LNode::isEqual().
Referenced by YACS::HMI::SceneComposedNodeItem::rebuildLinks().
bool LinkAStar::isAlreadyInList | ( | std::pair< int, int > | n, |
const LNodeMap & | aList | ||
) |
void LinkAStar::moveToClosedList | ( | std::pair< int, int > | n | ) |
Definition at line 178 of file LinkAStar.cxx.
References _closedList, _openList, and DEBTRACE.
Referenced by computePath().
|
protected |
Definition at line 86 of file LinkAStar.hxx.
Referenced by addNeighbours(), computePath(), givePath(), LinkAStar(), and moveToClosedList().
|
protected |
Definition at line 88 of file LinkAStar.hxx.
Referenced by computePath(), and givePath().
|
protected |
Definition at line 83 of file LinkAStar.hxx.
Referenced by addNeighbours().
|
protected |
Definition at line 87 of file LinkAStar.hxx.
Referenced by addNeighbours(), computePath(), LinkAStar(), and moveToClosedList().
|
protected |
Definition at line 90 of file LinkAStar.hxx.
Referenced by addNeighbours(), bestNode(), computePath(), and LinkAStar().
|
protected |
Definition at line 89 of file LinkAStar.hxx.
Referenced by addNeighbours(), computePath(), and givePath().