HOG2
|
#include <LearningUnit.h>
Public Member Functions | |
LearningUnit (state &s, state &target, LearningAlgorithm< state, action, environment > *alg) | |
virtual | ~LearningUnit () |
virtual const char * | GetName () |
bool | Done () |
void | StartNewTrial (StatCollection *s) |
virtual bool | MakeMove (environment *, OccupancyInterface< state, action > *, SimulationInfo< state, action, environment > *, action &a) |
virtual void | OpenGLDraw (const environment *e, const SimulationInfo< state, action, environment > *) const |
virtual void | UpdateLocation (environment *, state &s, bool success, SimulationInfo< state, action, environment > *) |
void | GetGoal (state &s) |
void | GetLocation (state &s) |
virtual void | LogFinalStats (StatCollection *s) |
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 | LogStats (StatCollection *) |
log an stats that may have been computed during the last run More... | |
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 int | GetPriority () |
virtual void | SetPriority (int val) |
Protected Attributes | |
long | nodesExpanded |
long | nodesTouched |
LearningAlgorithm< state, action, environment > * | algorithm |
double | totalLearned |
std::vector< state > | path |
state | currentLoc |
state | goalLoc |
Definition at line 18 of file LearningUnit.h.
|
inline |
Definition at line 21 of file LearningUnit.h.
References LearningUnit< state, action, environment >::algorithm, LearningUnit< state, action, environment >::currentLoc, LearningUnit< state, action, environment >::goalLoc, LearningUnit< state, action, environment >::StartNewTrial(), and LearningUnit< state, action, environment >::totalLearned.
|
inlinevirtual |
Definition at line 30 of file LearningUnit.h.
References LearningUnit< state, action, environment >::algorithm.
|
inlinevirtual |
Reimplemented from Unit< state, action, environment >.
Definition at line 32 of file LearningUnit.h.
References LearningUnit< state, action, environment >::algorithm, LearningUnit< state, action, environment >::currentLoc, fequal(), LearningUnit< state, action, environment >::goalLoc, and LearningUnit< state, action, environment >::totalLearned.
|
inlinevirtual |
Reimplemented from Unit< state, action, environment >.
Definition at line 61 of file LearningUnit.h.
References LearningUnit< state, action, environment >::goalLoc.
|
inlinevirtual |
Implements Unit< state, action, environment >.
Definition at line 62 of file LearningUnit.h.
References LearningUnit< state, action, environment >::currentLoc.
|
inlinevirtual |
Implements Unit< state, action, environment >.
Definition at line 31 of file LearningUnit.h.
References LearningUnit< state, action, environment >::algorithm.
Referenced by LearningUnit< state, action, environment >::LogFinalStats(), and LearningUnit< state, action, environment >::StartNewTrial().
|
inlinevirtual |
log any final one-time stats before a simulation is ended
Reimplemented from Unit< state, action, environment >.
Definition at line 63 of file LearningUnit.h.
References StatCollection::AddStat(), LearningUnit< state, action, environment >::algorithm, LearningUnit< state, action, environment >::GetName(), LearningUnit< state, action, environment >::nodesExpanded, and LearningUnit< state, action, environment >::nodesTouched.
|
virtual |
Implements Unit< state, action, environment >.
Definition at line 79 of file LearningUnit.h.
|
virtual |
Implements Unit< state, action, environment >.
Definition at line 100 of file LearningUnit.h.
References PublicUnitInfo< state, action, environment >::currentState, fgreater(), 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 |
Reimplemented from Unit< state, action, environment >.
Definition at line 33 of file LearningUnit.h.
References StatCollection::AddStat(), LearningUnit< state, action, environment >::algorithm, LearningUnit< state, action, environment >::GetName(), LearningUnit< state, action, environment >::nodesExpanded, LearningUnit< state, action, environment >::nodesTouched, and LearningUnit< state, action, environment >::totalLearned.
Referenced by LearningUnit< state, action, environment >::LearningUnit().
|
inlinevirtual |
Implements Unit< state, action, environment >.
Definition at line 50 of file LearningUnit.h.
References LearningUnit< state, action, environment >::currentLoc.
|
protected |
Definition at line 71 of file LearningUnit.h.
Referenced by LearningUnit< state, action, environment >::Done(), LearningUnit< state, action, environment >::GetName(), LearningUnit< state, action, environment >::LearningUnit(), LearningUnit< state, action, environment >::LogFinalStats(), LearningUnit< state, action, environment >::StartNewTrial(), and LearningUnit< state, action, environment >::~LearningUnit().
|
protected |
|
protected |
Definition at line 74 of file LearningUnit.h.
Referenced by LearningUnit< state, action, environment >::Done(), LearningUnit< state, action, environment >::GetGoal(), and LearningUnit< state, action, environment >::LearningUnit().
|
protected |
Definition at line 70 of file LearningUnit.h.
Referenced by LearningUnit< state, action, environment >::LogFinalStats(), and LearningUnit< state, action, environment >::StartNewTrial().
|
protected |
Definition at line 70 of file LearningUnit.h.
Referenced by LearningUnit< state, action, environment >::LogFinalStats(), and LearningUnit< state, action, environment >::StartNewTrial().
|
protected |
Definition at line 73 of file LearningUnit.h.
|
protected |
Definition at line 72 of file LearningUnit.h.
Referenced by LearningUnit< state, action, environment >::Done(), LearningUnit< state, action, environment >::LearningUnit(), and LearningUnit< state, action, environment >::StartNewTrial().