HOG2
|
HPA* algorithm as described in (Botea,Mueller,Schaeffer 2004). More...
#include <HPAStar.h>
Public Types | |
enum | Direction { NORTH, EAST, SOUTH, WEST, NE, SE, SW, NW } |
enum | SmoothType { BEGIN, END, TWO_BACK } |
Public Member Functions | |
hpaStar () | |
virtual | ~hpaStar () |
virtual path * | GetPath (GraphAbstraction *aMap, node *from, node *to, reservationProvider *rp=0) |
Returns the HPA* path between from and to. More... | |
virtual const char * | GetName () |
void | setUpSearch (node *from, node *to) |
path * | findAbstractPath (node *from, node *to) |
path * | findMapPath (path *abPath, node *from, node *to) |
void | cleanUpSearch () |
Remove the start & goal nodes from the Graph. More... | |
path * | smoothPath (path *p) |
from HPA* smoothwizard.cpp More... | |
void | setSmoothing (bool smooth) |
Set whether we want to do path smoothing. More... | |
void | setPartialPathLimit (int limit) |
int | getPartialPathLimit () |
void | setSmoothType (SmoothType s) |
Set the smoothing type. More... | |
void | setAbstraction (ClusterAbstraction *_m) |
Public Member Functions inherited from SearchAlgorithm | |
SearchAlgorithm () | |
virtual | ~SearchAlgorithm () |
uint64_t | GetNodesExpanded () |
uint64_t | GetNodesTouched () |
virtual void | LogFinalStats (StatCollection *) |
Protected Member Functions | |
path * | nextPathNode (node *n, int dir) |
shoot a ray in direction dir and see if you hit the path Return the better path if you find it; 0 if you hit a wall or obstacle (ie. More... | |
node * | getNextNode (int x, int y, int dir) |
get the next node from map coordinates (x,y) in direction dir. More... | |
bool | nextInLookup (int last, int curr, std::vector< node * > lookup) |
find out whether last is the next 'real' index in the lookup table after curr. More... | |
int | backTwoNodes (int i, std::vector< node * > lookup) |
Find the index of the node two nodes back in the path. More... | |
void | findMinMax (path *p) |
Protected Attributes | |
char | algName [30] |
ClusterAbstraction * | m |
int | partialLimit |
node * | fromnum |
node * | tonum |
std::vector< node * > | lookup |
bool | smoothing |
SmoothType | smType |
int | minx |
int | maxx |
int | miny |
int | maxy |
Additional Inherited Members | |
Public Attributes inherited from SearchAlgorithm | |
uint32_t | nodesExpanded |
uint32_t | nodesTouched |
HPA* algorithm as described in (Botea,Mueller,Schaeffer 2004).
Needs a ClusterAbstraction to run - use setAbstraction before doing any pathfinding
enum hpaStar::Direction |
enum hpaStar::SmoothType |
hpaStar::hpaStar | ( | ) |
Definition at line 19 of file HPAStar.cpp.
|
protected |
Find the index of the node two nodes back in the path.
Definition at line 434 of file HPAStar.cpp.
void hpaStar::cleanUpSearch | ( | ) |
Remove the start & goal nodes from the Graph.
Definition at line 280 of file HPAStar.cpp.
Definition at line 172 of file HPAStar.cpp.
References SearchAlgorithm::GetNodesExpanded(), SearchAlgorithm::GetNodesTouched(), aStarOld::GetPath(), path::Print(), and verbose.
Definition at line 198 of file HPAStar.cpp.
References Graph::FindEdge(), node::GetNum(), path::n, path::next, path, path::reverse(), and path::tail().
|
protected |
Definition at line 550 of file HPAStar.cpp.
References node::GetLabelL(), GraphAbstractionConstants::kFirstData, MAX_INT, path::n, and path::next.
|
inlinevirtual |
|
protected |
get the next node from map coordinates (x,y) in direction dir.
Will return 0 if there's no node here.
Definition at line 514 of file HPAStar.cpp.
|
inline |
Definition at line 54 of file HPAStar.h.
References partialLimit.
|
virtual |
Returns the HPA* path between from and to.
Before calling this function, set the abstraction with hpaStar::setAbstraction. The abstraction must be of type ClusterAbstraction.
Reservation provider isn't used
Implements SearchAlgorithm.
Definition at line 45 of file HPAStar.cpp.
References node::GetLabelF(), SearchAlgorithm::GetNodesExpanded(), SearchAlgorithm::GetNodesTouched(), aStarOld::GetPath(), GraphAbstractionConstants::kXCoordinate, GraphAbstractionConstants::kYCoordinate, path::n, path::next, path, point3d, path::tail(), and verbose.
|
protected |
find out whether last is the next 'real' index in the lookup table after curr.
This is to make sure we don't keep replacing little paths due to null's in the lookup table.
Definition at line 453 of file HPAStar.cpp.
shoot a ray in direction dir and see if you hit the path Return the better path if you find it; 0 if you hit a
wall or obstacle (ie.
if you won't find the path)
Definition at line 473 of file HPAStar.cpp.
References Graph::FindEdge(), node::GetLabelL(), node::GetNum(), GraphAbstractionConstants::kFirstData, GraphAbstractionConstants::kTemporaryLabel, and path.
|
inline |
|
inline |
Definition at line 52 of file HPAStar.h.
References algName, and partialLimit.
void hpaStar::setSmoothing | ( | bool | smooth | ) |
Set whether we want to do path smoothing.
Default is true.
Definition at line 33 of file HPAStar.cpp.
|
inline |
Set the smoothing type.
Whenever we update the path with a better subpath, if s = BEGIN, smoothing is restarted from the beginning of this subpath if s = END, smoothing is restarted from the end of the new subpath if s = TWO_BACK, we go back two from the end of the new subpath
Definition at line 63 of file HPAStar.h.
References smType.
Definition at line 148 of file HPAStar.cpp.
References verbose.
from HPA* smoothwizard.cpp
smoothen the path by replacing parts of the path by straight lines.
Definition at line 299 of file HPAStar.cpp.
References node::GetLabelL(), GraphAbstractionConstants::kFirstData, GraphAbstractionConstants::kTemporaryLabel, path::n, path::next, path, node::SetLabelL(), path::tail(), and verbose.
|
protected |
Definition at line 69 of file HPAStar.h.
Referenced by GetName(), and setPartialPathLimit().
|
protected |
Definition at line 70 of file HPAStar.h.
Referenced by setAbstraction().
|
protected |
Definition at line 71 of file HPAStar.h.
Referenced by getPartialPathLimit(), and setPartialPathLimit().
|
protected |
Definition at line 78 of file HPAStar.h.
Referenced by setSmoothType().