HOG2
|
A general unit which collects path information from a GenericSearchAlgorithm and incrementally executes that path in the world. More...
#include <GenericSearchUnit.h>
Public Member Functions | |
GenericSearchUnit (state &start, state &goal, GenericSearchAlgorithm< state, action, environment > *alg) | |
GenericSearchUnit (state &start, Unit< state, action, environment > *target, GenericSearchAlgorithm< state, action, environment > *alg) | |
virtual | ~GenericSearchUnit () |
virtual const char * | GetName () |
virtual GenericSearchAlgorithm< state, action, environment > * | getAlgorithm () |
virtual bool | Done () |
virtual void | GetGoal (state &s) |
virtual void | SetTarget (Unit< state, action, environment > *u) |
virtual Unit< state, action, environment > * | GetTarget () |
virtual bool | MakeMove (environment *env, OccupancyInterface< state, action > *oi, SimulationInfo< state, action, environment > *si, action &a) |
virtual void | UpdateLocation (environment *env, state &l, bool success, SimulationInfo< state, action, environment > *si) |
virtual void | GetLocation (state &s) |
virtual void | OpenGLDraw (const environment *, const SimulationInfo< state, action, environment > *) 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 Unit< state, action, environment > | |
Unit () | |
virtual | ~Unit () |
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) |
Protected Member Functions | |
virtual void | AddPathToCache (environment *env, std::vector< state > &path) |
Store path as a vector of actions. More... | |
bool | getCachedMove (action &a) |
Protected Attributes | |
int | nodesExpanded |
int | nodesTouched |
std::vector< action > | moves |
GenericSearchAlgorithm< state, action, environment > * | algorithm |
Unit< state, action, environment > * | target |
state | loc |
state | goal |
state | lastloc |
double | targetTime |
double | lastTime |
bool | onTarget |
A general unit which collects path information from a GenericSearchAlgorithm and incrementally executes that path in the world.
Definition at line 46 of file GenericSearchUnit.h.
GenericSearchUnit< state, action, environment >::GenericSearchUnit | ( | state & | start, |
state & | goal, | ||
GenericSearchAlgorithm< state, action, environment > * | alg | ||
) |
Definition at line 90 of file GenericSearchUnit.h.
GenericSearchUnit< state, action, environment >::GenericSearchUnit | ( | state & | start, |
Unit< state, action, environment > * | target, | ||
GenericSearchAlgorithm< state, action, environment > * | alg | ||
) |
Definition at line 112 of file GenericSearchUnit.h.
|
virtual |
Definition at line 127 of file GenericSearchUnit.h.
|
protectedvirtual |
Store path as a vector of actions.
??? Rename moves --> actions? Moves only for maps?
Reimplemented in GenericPatrolUnit< state, action, environment >.
Definition at line 271 of file GenericSearchUnit.h.
|
inlinevirtual |
Reimplemented from Unit< state, action, environment >.
Reimplemented in GenericPatrolUnit< state, action, environment >.
Definition at line 54 of file GenericSearchUnit.h.
References GenericSearchUnit< state, action, environment >::goal.
|
inlinevirtual |
Definition at line 52 of file GenericSearchUnit.h.
References GenericSearchUnit< state, action, environment >::algorithm.
|
protected |
Definition at line 280 of file GenericSearchUnit.h.
|
inlinevirtual |
Reimplemented from Unit< state, action, environment >.
Reimplemented in GenericPatrolUnit< state, action, environment >.
Definition at line 55 of file GenericSearchUnit.h.
References GenericSearchUnit< state, action, environment >::goal.
Referenced by GenericPatrolUnit< state, action, environment >::GetGoal().
|
inlinevirtual |
Implements Unit< state, action, environment >.
Reimplemented in GenericPatrolUnit< state, action, environment >.
Definition at line 64 of file GenericSearchUnit.h.
References GenericSearchUnit< state, action, environment >::loc.
|
inlinevirtual |
Implements Unit< state, action, environment >.
Reimplemented in GenericPatrolUnit< state, action, environment >.
Definition at line 51 of file GenericSearchUnit.h.
References GenericSearchUnit< state, action, environment >::algorithm.
|
inlinevirtual |
Definition at line 58 of file GenericSearchUnit.h.
References GenericSearchUnit< state, action, environment >::target.
|
virtual |
log any final one-time stats before a simulation is ended
Reimplemented from Unit< state, action, environment >.
Definition at line 261 of file GenericSearchUnit.h.
|
virtual |
log an stats that may have been computed during the last run
Reimplemented from Unit< state, action, environment >.
Definition at line 244 of file GenericSearchUnit.h.
References StatCollection::AddStat().
|
virtual |
Implements Unit< state, action, environment >.
Reimplemented in GenericPatrolUnit< state, action, environment >.
Definition at line 132 of file GenericSearchUnit.h.
References SimulationInfo< state, action, environment >::GetSimulationTime(), and path.
|
virtual |
Implements Unit< state, action, environment >.
Reimplemented in GenericPatrolUnit< state, action, environment >.
Definition at line 202 of file GenericSearchUnit.h.
References PublicUnitInfo< state, action, environment >::currentState, fgreater(), Colors::GetColor(), SimulationInfo< state, action, environment >::GetCurrentUnit(), SimulationInfo< state, action, environment >::GetPublicUnitInfo(), SimulationInfo< state, action, environment >::GetSimulationTime(), PublicUnitInfo< state, action, environment >::lastState, PublicUnitInfo< state, action, environment >::lastTime, and PublicUnitInfo< state, action, environment >::nextTime.
|
inlinevirtual |
Definition at line 57 of file GenericSearchUnit.h.
References GenericSearchUnit< state, action, environment >::target.
|
virtual |
Implements Unit< state, action, environment >.
Reimplemented in GenericPatrolUnit< state, action, environment >.
Definition at line 294 of file GenericSearchUnit.h.
References SimulationInfo< state, action, environment >::GetSimulationTime().
|
protected |
Definition at line 79 of file GenericSearchUnit.h.
Referenced by GenericSearchUnit< state, action, environment >::getAlgorithm(), and GenericSearchUnit< state, action, environment >::GetName().
|
protected |
Definition at line 83 of file GenericSearchUnit.h.
Referenced by GenericSearchUnit< state, action, environment >::Done(), and GenericSearchUnit< state, action, environment >::GetGoal().
|
protected |
Definition at line 83 of file GenericSearchUnit.h.
|
protected |
Definition at line 84 of file GenericSearchUnit.h.
|
protected |
Definition at line 83 of file GenericSearchUnit.h.
Referenced by GenericSearchUnit< state, action, environment >::GetLocation().
|
protected |
Definition at line 77 of file GenericSearchUnit.h.
|
protected |
Definition at line 75 of file GenericSearchUnit.h.
|
protected |
Definition at line 76 of file GenericSearchUnit.h.
|
protected |
Definition at line 85 of file GenericSearchUnit.h.
|
protected |
Definition at line 81 of file GenericSearchUnit.h.
Referenced by GenericSearchUnit< state, action, environment >::GetTarget(), and GenericSearchUnit< state, action, environment >::SetTarget().
|
protected |
Definition at line 84 of file GenericSearchUnit.h.