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

patrolUnit Class Reference

#include <patrolUnit.h>

Inheritance diagram for patrolUnit:

Inheritance graph
[legend]
Collaboration diagram for patrolUnit:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 patrolUnit (int x, int y)
 patrolUnit (int _x, int _y, int numPLocations, unitSimulation *us)
 Creates a patrol unit and assigns it numPLocations random locations to patrol.

virtual const char * getName ()
virtual tDirection makeMove (mapProvider *, reservationProvider *, simulationInfo *simInfo)
 The new makeMove only gives a map.

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

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

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


Private Member Functions

double goToLoc (mapAbstraction *aMap, int which)
void addPathToCache (path *p)

Private Attributes

std::vector< tDirectionmoves
std::vector< unit * > Locs
aStar a
int currTarget
int nodesExpanded
int nodesTouched

Constructor & Destructor Documentation

patrolUnit::patrolUnit int  x,
int  y
 

patrolUnit::patrolUnit int  _x,
int  _y,
int  numPLocations,
unitSimulation us
 

Creates a patrol unit and assigns it numPLocations random locations to patrol.

The last location is the unit's starting position to create a loop


Member Function Documentation

void patrolUnit::addPathToCache path p  )  [private]
 

void patrolUnit::addPatrolLocation unit  ) 
 

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

Reimplemented from unit.

unit * patrolUnit::getTarget  ) 
 

Reimplemented from unit.

double patrolUnit::goToLoc mapAbstraction aMap,
int  which
[private]
 

void patrolUnit::logFinalStats statCollection stats  )  [virtual]
 

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

Reimplemented from unit.

void patrolUnit::logStats statCollection stats  )  [virtual]
 

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

No stats collected by default.

Reimplemented from unit.

tDirection patrolUnit::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.

void patrolUnit::openGLDraw mapProvider mp,
simulationInfo
[virtual]
 

Draw the unit.

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

Reimplemented from unit.

void patrolUnit::updateLocation int  _x,
int  _y,
bool  worked,
simulationInfo
[inline, 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

aStar patrolUnit::a [private]
 

int patrolUnit::currTarget [private]
 

std::vector<unit *> patrolUnit::Locs [private]
 

std::vector<tDirection> patrolUnit::moves [private]
 

int patrolUnit::nodesExpanded [private]
 

int patrolUnit::nodesTouched [private]
 


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