HOG2
Public Member Functions | Protected Attributes | List of all members
AbsMapUnit Class Referenceabstract

A simple map-based unit. More...

#include <AbsMapUnit.h>

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

Public Member Functions

 AbsMapUnit (int x, int y)
 
virtual ~AbsMapUnit ()
 
virtual const char * GetName ()=0
 
virtual bool MakeMove (AbsMapEnvironment *, OccupancyInterface< xyLoc, tDirection > *, AbsMapSimulationInfo *, tDirection &)=0
 
virtual void UpdateLocation (AbsMapEnvironment *, xyLoc &l, bool, AbsMapSimulationInfo *)
 
virtual void GetLocation (xyLoc &l)
 
virtual void GetGoal (xyLoc &s)=0
 
virtual void OpenGLDraw (const AbsMapEnvironment *, const AbsMapSimulationInfo *) const
 
- 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 bool Done ()
 
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 LogFinalStats (StatCollection *)
 log any final one-time stats before a simulation is ended 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 void StartNewTrial (StatCollection *)
 
virtual int GetPriority ()
 
virtual void SetPriority (int val)
 

Protected Attributes

GLfloat r
 
GLfloat g
 
GLfloat b
 
xyLoc loc
 

Detailed Description

A simple map-based unit.

Definition at line 24 of file AbsMapUnit.h.

Constructor & Destructor Documentation

◆ AbsMapUnit()

AbsMapUnit::AbsMapUnit ( int  x,
int  y 
)
inline

Definition at line 26 of file AbsMapUnit.h.

References b, g, and r.

◆ ~AbsMapUnit()

virtual AbsMapUnit::~AbsMapUnit ( )
inlinevirtual

Definition at line 28 of file AbsMapUnit.h.

Member Function Documentation

◆ GetGoal()

virtual void AbsMapUnit::GetGoal ( xyLoc s)
pure virtual

Implemented in SearchUnit.

◆ GetLocation()

virtual void AbsMapUnit::GetLocation ( xyLoc l)
inlinevirtual

Definition at line 34 of file AbsMapUnit.h.

References loc.

Referenced by SearchUnit::GetGoal(), SearchUnit::makeMove(), and SearchUnit::OpenGLDraw().

◆ GetName()

virtual const char* AbsMapUnit::GetName ( )
pure virtual

Implements Unit< state, action, environment >.

Implemented in SearchUnit, and praStarUnit.

◆ MakeMove()

virtual bool AbsMapUnit::MakeMove ( AbsMapEnvironment *  ,
OccupancyInterface< xyLoc, tDirection > *  ,
AbsMapSimulationInfo ,
tDirection  
)
pure virtual

Implemented in SearchUnit.

◆ OpenGLDraw()

void AbsMapUnit::OpenGLDraw ( const AbsMapEnvironment *  me,
const AbsMapSimulationInfo  
) const
virtual

Reimplemented in SearchUnit.

Definition at line 12 of file AbsMapUnit.cpp.

References b, DrawSphere(), g, Map::GetMapHeight(), Map::GetMapWidth(), Map::GetOpenGLCoord(), r, loc::x, and loc::y.

◆ UpdateLocation()

virtual void AbsMapUnit::UpdateLocation ( AbsMapEnvironment *  ,
xyLoc l,
bool  ,
AbsMapSimulationInfo  
)
inlinevirtual

Reimplemented in SearchUnit.

Definition at line 32 of file AbsMapUnit.h.

Member Data Documentation

◆ b

GLfloat AbsMapUnit::b
protected

Definition at line 42 of file AbsMapUnit.h.

Referenced by AbsMapUnit(), OpenGLDraw(), and SearchUnit::OpenGLDraw().

◆ g

GLfloat AbsMapUnit::g
protected

Definition at line 42 of file AbsMapUnit.h.

Referenced by AbsMapUnit(), OpenGLDraw(), and SearchUnit::OpenGLDraw().

◆ loc

xyLoc AbsMapUnit::loc
protected

Definition at line 43 of file AbsMapUnit.h.

Referenced by GetLocation().

◆ r

GLfloat AbsMapUnit::r
protected

Definition at line 42 of file AbsMapUnit.h.

Referenced by AbsMapUnit(), OpenGLDraw(), and SearchUnit::OpenGLDraw().


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