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

searchUnit Class Reference

A general unit which collects path information from a searchAlgorithm and incrementally executes that path in the world. More...

#include <searchUnit.h>

Inheritance diagram for searchUnit:

Inheritance graph
[legend]
Collaboration diagram for searchUnit:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 searchUnit (int x, int y, unit *target, searchAlgorithm *alg)
 searchUnit (int x, int y, unit *target, spreadExecSearchAlgorithm *alg)
 searchUnit (int _x, int _y, int _r, int _g, int _b, unit *_target, searchAlgorithm *alg)
 searchUnit (int _x, int _y, float _r, float _g, float _b, unit *_target, searchAlgorithm *alg)
virtual ~searchUnit ()
virtual const char * getName ()
virtual searchAlgorithmgetAlgorithm ()
virtual bool done ()
virtual tDirection makeMove (mapProvider *, reservationProvider *, simulationInfo *simInfo)
 The new makeMove only gives a map.

virtual void updateLocation (int _x, int _y, bool, simulationInfo *)
 updateLocation only tells a unit where it is located, it doesn't physically change the location in the world

virtual void openGLDraw (mapProvider *, simulationInfo *)
 Draw the unit.

void logStats (statCollection *stats)
 log an stats that may have been computed during the last run

void logFinalStats (statCollection *stats)
 log any final one-time stats before a simulation is ended


Protected Member Functions

virtual void addPathToCache (path *p)
bool getCachedMove (tDirection &dir)

Protected Attributes

int nodesExpanded
int nodesTouched
std::vector< tDirectionmoves
searchAlgorithmalgorithm
spreadExecSearchAlgorithms_algorithm
pathspread_cache
double targetTime
bool onTarget

Detailed Description

A general unit which collects path information from a searchAlgorithm and incrementally executes that path in the world.


Constructor & Destructor Documentation

searchUnit::searchUnit int  x,
int  y,
unit target,
searchAlgorithm alg
 

searchUnit::searchUnit int  x,
int  y,
unit target,
spreadExecSearchAlgorithm alg
 

searchUnit::searchUnit int  _x,
int  _y,
int  _r,
int  _g,
int  _b,
unit _target,
searchAlgorithm alg
 

searchUnit::searchUnit int  _x,
int  _y,
float  _r,
float  _g,
float  _b,
unit _target,
searchAlgorithm alg
 

searchUnit::~searchUnit  )  [virtual]
 


Member Function Documentation

void searchUnit::addPathToCache path p  )  [protected, virtual]
 

virtual bool searchUnit::done  )  [inline, virtual]
 

Reimplemented from unit.

Reimplemented in KoenigsUnit, LRTAStarUnit, patUnit, PrioritizedUnit, and PRLRTSkUnit.

virtual searchAlgorithm* searchUnit::getAlgorithm  )  [inline, virtual]
 

bool searchUnit::getCachedMove tDirection dir  )  [protected]
 

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

Reimplemented from unit.

Reimplemented in KoenigsUnit, PrioritizedUnit, PRLRTSkUnit, and praStarUnit.

void searchUnit::logFinalStats statCollection stats  )  [virtual]
 

log any final one-time stats before a simulation is ended

Reimplemented from unit.

void searchUnit::logStats statCollection stats  )  [virtual]
 

log an stats that may have been computed during the last run

No stats collected by default.

Reimplemented from unit.

Reimplemented in KoenigsUnit, PrioritizedUnit, and PRLRTSkUnit.

tDirection searchUnit::makeMove mapProvider ,
reservationProvider ,
simulationInfo simInfo
[virtual]
 

The new makeMove only gives a map.

The unit simulation won't calculate an mapAbstraction unless it has to. Thus, in simple pathfinding tests, the overhead is saved.

Reimplemented from unit.

Reimplemented in KoenigsUnit, LRTAStarUnit, PrioritizedUnit, PRLRTSkUnit, and praStarUnit.

void searchUnit::openGLDraw mapProvider mp,
simulationInfo si
[virtual]
 

Draw the unit.

Draw the unit using openGL. Overload this if you want a custom look for the unit.

Reimplemented from unit.

void searchUnit::updateLocation int  _x,
int  _y,
bool  success,
simulationInfo
[virtual]
 

updateLocation only tells a unit where it is located, it doesn't physically change the location in the world

Reimplemented from unit.


Member Data Documentation

searchAlgorithm* searchUnit::algorithm [protected]
 

Reimplemented in KoenigsUnit, LRTAStarUnit, PrioritizedUnit, PRLRTSkUnit, and praStarUnit.

std::vector<tDirection> searchUnit::moves [protected]
 

int searchUnit::nodesExpanded [protected]
 

int searchUnit::nodesTouched [protected]
 

bool searchUnit::onTarget [protected]
 

spreadExecSearchAlgorithm* searchUnit::s_algorithm [protected]
 

path* searchUnit::spread_cache [protected]
 

double searchUnit::targetTime [protected]
 


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