HOG2
Public Member Functions | Private Attributes | List of all members
praStarUnit Class Reference

A unit which caches path information to speed pra*. More...

#include <PRAStarUnit.h>

Inheritance diagram for praStarUnit:
Inheritance graph
[legend]
Collaboration diagram for praStarUnit:
Collaboration graph
[legend]

Public Member Functions

 praStarUnit (int _x, int _y, unit *_target, praStar *_alg)
 
 ~praStarUnit ()
 
const char * GetName ()
 
tDirection makeMove (MapProvider *, reservationProvider *, SimulationInfo *simInfo)
 
- Public Member Functions inherited from SearchUnit
 SearchUnit (int x, int y, AbsMapUnit *target, SearchAlgorithm *alg)
 
virtual ~SearchUnit ()
 
virtual SearchAlgorithmgetAlgorithm ()
 
virtual bool Done ()
 
void GetGoal (xyLoc &gs)
 
virtual void setTarget (AbsMapUnit *u)
 
virtual bool MakeMove (AbsMapEnvironment *ame, OccupancyInterface< xyLoc, tDirection > *, AbsMapSimulationInfo *si, tDirection &dir)
 
virtual bool makeMove (MapProvider *, reservationProvider *, AbsMapSimulationInfo *simInfo, tDirection &dir)
 
void UpdateLocation (AbsMapEnvironment *, xyLoc &l, bool success, AbsMapSimulationInfo *si)
 
virtual void updateLocation (int _x, int _y, bool, AbsMapSimulationInfo *)
 
virtual void OpenGLDraw (const AbsMapEnvironment *, const AbsMapSimulationInfo *) const
 
void LogStats (StatCollection *stats)
 log an stats that may have been computed during the last run More...
 
void LogFinalStats (StatCollection *stats)
 log any final one-time stats before a simulation is ended More...
 
- Public Member Functions inherited from AbsMapUnit
 AbsMapUnit (int x, int y)
 
virtual ~AbsMapUnit ()
 
virtual void GetLocation (xyLoc &l)
 
- Public Member Functions inherited from Unit< state, action, environment >
 Unit ()
 
virtual ~Unit ()
 
virtual bool MakeMove (environment *, OccupancyInterface< state, action > *, SimulationInfo< state, action, environment > *, action &a)=0
 
virtual void UpdateLocation (environment *, state &, bool success, SimulationInfo< state, action, environment > *)=0
 
virtual void GetLocation (state &)=0
 
virtual void OpenGLDraw (const environment *, const SimulationInfo< state, action, environment > *) const =0
 
virtual void GetGoal (state &s)
 
virtual double GetSpeed ()
 
void SetSpeed (double s)
 
virtual void SetColor (GLfloat _r, GLfloat _g, GLfloat _b)
 
virtual void GetColor (GLfloat &_r, GLfloat &_g, GLfloat &_b) const
 
UnitGroup< state, action, environment > * GetUnitGroup ()
 
void SetUnitGroup (UnitGroup< state, action, environment > *_group)
 
virtual unsigned int GetNum ()
 
virtual void SetNum (unsigned int num)
 
virtual void StartNewTrial (StatCollection *)
 
virtual int GetPriority ()
 
virtual void SetPriority (int val)
 

Private Attributes

pathcache
 
praStaralgorithm
 
char name [32]
 

Additional Inherited Members

- Protected Member Functions inherited from SearchUnit
virtual void addPathToCache (path *p)
 
bool getCachedMove (tDirection &dir)
 
- Protected Attributes inherited from SearchUnit
int nodesExpanded
 
int nodesTouched
 
std::vector< tDirectionmoves
 
SearchAlgorithmalgorithm
 
spreadExecSearchAlgorithms_algorithm
 
pathspread_cache
 
AbsMapUnittarget
 
double targetTime
 
bool onTarget
 
- Protected Attributes inherited from AbsMapUnit
GLfloat r
 
GLfloat g
 
GLfloat b
 
xyLoc loc
 

Detailed Description

A unit which caches path information to speed pra*.

Definition at line 23 of file PRAStarUnit.h.

Constructor & Destructor Documentation

◆ praStarUnit()

praStarUnit::praStarUnit ( int  _x,
int  _y,
unit *  _target,
praStar _alg 
)

Definition at line 14 of file PRAStarUnit.cpp.

References cache.

◆ ~praStarUnit()

praStarUnit::~praStarUnit ( )
inline

Definition at line 27 of file PRAStarUnit.h.

References cache.

Member Function Documentation

◆ GetName()

const char* praStarUnit::GetName ( )
inlinevirtual

Reimplemented from SearchUnit.

Definition at line 28 of file PRAStarUnit.h.

References algorithm, praStar::GetName(), and name.

◆ makeMove()

tDirection praStarUnit::makeMove ( MapProvider mp,
reservationProvider rp,
SimulationInfo simInfo 
)

Member Data Documentation

◆ algorithm

praStar* praStarUnit::algorithm
private

Definition at line 32 of file PRAStarUnit.h.

Referenced by GetName(), and makeMove().

◆ cache

path* praStarUnit::cache
private

Definition at line 31 of file PRAStarUnit.h.

Referenced by makeMove(), praStarUnit(), and ~praStarUnit().

◆ name

char praStarUnit::name[32]
private

Definition at line 33 of file PRAStarUnit.h.

Referenced by GetName().


The documentation for this class was generated from the following files: