HOG2
|
A unit which caches path information to speed pra*. More...
#include <PRAStarUnit.h>
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 SearchAlgorithm * | getAlgorithm () |
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 | |
path * | cache |
praStar * | algorithm |
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< tDirection > | moves |
SearchAlgorithm * | algorithm |
spreadExecSearchAlgorithm * | s_algorithm |
path * | spread_cache |
AbsMapUnit * | target |
double | targetTime |
bool | onTarget |
Protected Attributes inherited from AbsMapUnit | |
GLfloat | r |
GLfloat | g |
GLfloat | b |
xyLoc | loc |
A unit which caches path information to speed pra*.
Definition at line 23 of file PRAStarUnit.h.
praStarUnit::praStarUnit | ( | int | _x, |
int | _y, | ||
unit * | _target, | ||
praStar * | _alg | ||
) |
Definition at line 14 of file PRAStarUnit.cpp.
References cache.
|
inline |
Definition at line 27 of file PRAStarUnit.h.
References cache.
|
inlinevirtual |
Reimplemented from SearchUnit.
Definition at line 28 of file PRAStarUnit.h.
References algorithm, praStar::GetName(), and name.
tDirection praStarUnit::makeMove | ( | MapProvider * | mp, |
reservationProvider * | rp, | ||
SimulationInfo * | simInfo | ||
) |
Definition at line 23 of file PRAStarUnit.cpp.
References algorithm, cache, node::GetLabelL(), MapProvider::GetMapAbstraction(), GraphAbstractionConstants::kAbstractionLevel, SearchUnit::makeMove(), SearchUnit::moves, path::n, path::next, praStar::setCache(), praStar::setExpandSearchRadius(), loc::x, and loc::y.
|
private |
Definition at line 32 of file PRAStarUnit.h.
Referenced by GetName(), and makeMove().
|
private |
Definition at line 31 of file PRAStarUnit.h.
Referenced by makeMove(), praStarUnit(), and ~praStarUnit().
|
private |
Definition at line 33 of file PRAStarUnit.h.
Referenced by GetName().