Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

hpaStar Class Reference

HPA* algorithm as described in (Botea,Mueller,Schaeffer 2004). More...

#include <hpaStar.h>

Inheritance diagram for hpaStar:

Inheritance graph
[legend]
Collaboration diagram for hpaStar:

Collaboration graph
[legend]
List of all members.

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 pathgetPath (graphAbstraction *aMap, node *from, node *to, reservationProvider *rp=0)
 Returns the HPA* path between from and to.

virtual const char * getName ()
void setUpSearch (node *from, node *to)
pathfindAbstractPath (node *from, node *to)
pathfindMapPath (path *abPath, node *from, node *to)
void cleanUpSearch ()
 Remove the start & goal nodes from the graph.

pathsmoothPath (path *p)
 from HPA* smoothwizard.cpp

void setSmoothing (bool smooth)
 Set whether we want to do path smoothing.

void setPartialPathLimit (int limit)
int getPartialPathLimit ()
void setSmoothType (SmoothType s)
 Set the smoothing type.

void setAbstraction (clusterAbstraction *_m)

Protected Member Functions

pathnextPathNode (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.

nodegetNextNode (int x, int y, int dir)
 get the next node from map coordinates (x,y) in direction dir.

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.

int backTwoNodes (int i, std::vector< node * > lookup)
 Find the index of the node two nodes back in the path.

void findMinMax (path *p)

Protected Attributes

char algName [30]
clusterAbstractionm
int partialLimit
nodefromnum
nodetonum
std::vector< node * > lookup
bool smoothing
SmoothType smType
int minx
int maxx
int miny
int maxy

Detailed Description

HPA* algorithm as described in (Botea,Mueller,Schaeffer 2004).

Needs a clusterAbstraction to run - use setAbstraction before doing any pathfinding


Member Enumeration Documentation

enum hpaStar::Direction
 

Enumeration values:
NORTH 
EAST 
SOUTH 
WEST 
NE 
SE 
SW 
NW 

enum hpaStar::SmoothType
 

Enumeration values:
BEGIN 
END 
TWO_BACK 


Constructor & Destructor Documentation

hpaStar::hpaStar  ) 
 

virtual hpaStar::~hpaStar  )  [inline, virtual]
 


Member Function Documentation

int hpaStar::backTwoNodes int  i,
std::vector< node * >  lookup
[protected]
 

Find the index of the node two nodes back in the path.

void hpaStar::cleanUpSearch  ) 
 

Remove the start & goal nodes from the graph.

path * hpaStar::findAbstractPath node from,
node to
 

path * hpaStar::findMapPath path abPath,
node from,
node to
 

void hpaStar::findMinMax path p  )  [protected]
 

virtual const char* hpaStar::getName  )  [inline, virtual]
 

Implements searchAlgorithm.

node * hpaStar::getNextNode int  x,
int  y,
int  dir
[protected]
 

get the next node from map coordinates (x,y) in direction dir.

Will return 0 if there's no node here.

int hpaStar::getPartialPathLimit  )  [inline]
 

path * hpaStar::getPath graphAbstraction aMap,
node from,
node to,
reservationProvider rp = 0
[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.

bool hpaStar::nextInLookup int  last,
int  curr,
std::vector< node * >  lookup
[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.

path * hpaStar::nextPathNode node n,
int  dir
[protected]
 

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)

void hpaStar::setAbstraction clusterAbstraction _m  )  [inline]
 

void hpaStar::setPartialPathLimit int  limit  )  [inline]
 

void hpaStar::setSmoothing bool  smooth  ) 
 

Set whether we want to do path smoothing.

Default is true.

void hpaStar::setSmoothType SmoothType  s  )  [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

void hpaStar::setUpSearch node from,
node to
 

path * hpaStar::smoothPath path p  ) 
 

from HPA* smoothwizard.cpp

smoothen the path by replacing parts of the path by straight lines.


Member Data Documentation

char hpaStar::algName[30] [protected]
 

node* hpaStar::fromnum [protected]
 

std::vector<node*> hpaStar::lookup [protected]
 

clusterAbstraction* hpaStar::m [protected]
 

int hpaStar::maxx [protected]
 

int hpaStar::maxy [protected]
 

int hpaStar::minx [protected]
 

int hpaStar::miny [protected]
 

int hpaStar::partialLimit [protected]
 

bool hpaStar::smoothing [protected]
 

SmoothType hpaStar::smType [protected]
 

node* hpaStar::tonum [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Aug 18 03:42:58 2009 for HOG by doxygen 1.3.4