Go to the documentation of this file.
9 #ifndef hog2_glut_LearningUnit_h
10 #define hog2_glut_LearningUnit_h
17 template <
class state,
class action,
class environment>
78 template <
class state,
class action,
class environment>
81 if (currentLoc == goalLoc)
87 algorithm->GetPath(e, currentLoc, goalLoc,
path);
88 nodesExpanded += algorithm->GetNodesExpanded();
89 nodesTouched += algorithm->GetNodesTouched();
99 template <
class state,
class action,
class environment>
104 e->SetColor(0.5, 0.25, 0.0, 1.0);
112 e->SetColor(0.0, 1.0, 0.0, 1.0);
113 e->OpenGLDraw(goalLoc);
114 e->SetColor(1.0, 1.0, 0.0, 1.0);
115 e->OpenGLDraw(currentLoc);
117 algorithm->OpenGLDraw(e);
std::vector< state > path
virtual bool MakeMove(environment *, OccupancyInterface< state, action > *, SimulationInfo< state, action, environment > *, action &a)
virtual const char * GetName()
virtual double GetSimulationTime() const =0
virtual void LogFinalStats(StatCollection *s)
log any final one-time stats before a simulation is ended
bool fgreater(double a, double b)
virtual void GetPublicUnitInfo(unsigned int unitnum, PublicUnitInfo< state, action, environment > &) const =0
The StatCollection class is for collecting stats across different parts of the simulation.
LearningAlgorithm< state, action, environment > * algorithm
void AddStat(const char *category, const char *owner, double value)
Add a new stat entry for the given category, owner and value.
void GetLocation(state &s)
virtual unsigned int GetCurrentUnit() const =0
LearningUnit(state &s, state &target, LearningAlgorithm< state, action, environment > *alg)
A linked list of nodes which form a continuous path.
bool fequal(double a, double b, double tolerance=TOLERANCE)
virtual void OpenGLDraw(const environment *e, const SimulationInfo< state, action, environment > *) const
void StartNewTrial(StatCollection *s)
virtual void UpdateLocation(environment *, state &s, bool success, SimulationInfo< state, action, environment > *)