HOG2
Public Member Functions | List of all members
RandomerUnit Class Reference

A unit that moves in random directions for every step. More...

#include <RandomUnits.h>

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

Public Member Functions

 RandomerUnit (int _x, int _y)
 
const char * GetName ()
 
bool MakeMove (MapEnvironment *, OccupancyInterface< xyLoc, tDirection > *, MapSimulationInfo *, tDirection &dir)
 Make a random move. More...
 
- Public Member Functions inherited from MapUnit
 MapUnit (int x, int y)
 
virtual void UpdateLocation (MapEnvironment *, xyLoc &l, bool, MapSimulationInfo *)
 
virtual void GetLocation (xyLoc &l)
 
virtual void OpenGLDraw (const MapEnvironment *, const MapSimulationInfo *) const
 
virtual void GetGoal (xyLoc &s)
 
- Public Member Functions inherited from Unit< xyLoc, tDirection, MapEnvironment >
 Unit ()
 
virtual ~Unit ()
 
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< xyLoc, tDirection, MapEnvironment > * GetUnitGroup ()
 
void SetUnitGroup (UnitGroup< xyLoc, tDirection, MapEnvironment > *_group)
 
virtual unsigned int GetNum ()
 
virtual void SetNum (unsigned int num)
 
virtual void StartNewTrial (StatCollection *)
 
virtual int GetPriority ()
 
virtual void SetPriority (int val)
 

Additional Inherited Members

- Protected Attributes inherited from MapUnit
GLfloat r
 
GLfloat g
 
GLfloat b
 
xyLoc loc
 

Detailed Description

A unit that moves in random directions for every step.

Definition at line 52 of file RandomUnits.h.

Constructor & Destructor Documentation

◆ RandomerUnit()

RandomerUnit::RandomerUnit ( int  _x,
int  _y 
)
inline

Definition at line 54 of file RandomUnits.h.

Member Function Documentation

◆ GetName()

const char* RandomerUnit::GetName ( )
inlinevirtual

Implements Unit< xyLoc, tDirection, MapEnvironment >.

Definition at line 56 of file RandomUnits.h.

◆ MakeMove()

bool RandomerUnit::MakeMove ( MapEnvironment ,
OccupancyInterface< xyLoc, tDirection > *  ,
MapSimulationInfo ,
tDirection dir 
)
virtual

Make a random move.

the random unit follows a certain direction for a random amount of time, and then picks a new direction. makeMove just returns the current direction.

Implements Unit< xyLoc, tDirection, MapEnvironment >.

Definition at line 50 of file RandomUnits.cpp.

References possibleDir.


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