HOG2
Public Member Functions | Protected Attributes | List of all members
SharedAMapGroup Class Reference

A group which incrementally builds a map of the world as the units in the group explore the Graph. More...

#include <SharedAMapGroup.h>

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

Public Member Functions

 SharedAMapGroup (MapProvider *)
 
 ~SharedAMapGroup ()
 
virtual const char * GetName ()
 
virtual void OpenGLDraw (const AbsMapEnvironment *, const AbsMapSimulationInfo *) const
 
virtual MapGetMap () const
 
virtual MapAbstraction * GetMapAbstraction ()
 
virtual int GetNewTileCount ()
 
void UpdateLocation (Unit< xyLoc, tDirection, AbsMapEnvironment > *u, AbsMapEnvironment *, xyLoc &loc, bool success, AbsMapSimulationInfo *)
 reset the location of a given unit More...
 
virtual bool Done ()
 Is the group done with their exploration? More...
 
void StartNewTrial (StatCollection *stats)
 Lets the unit group do what it needs to reset a trial. More...
 
void LogStats (StatCollection *stats)
 
void SetVisibilityRadius (int _visibility)
 
int GetVisibilityRadius ()
 
bool Explored (int x, int y)
 
bool Explored (unsigned int _node)
 
int GetNewTileCountPerStep ()
 
bool SeenBefore (int x, int y)
 
- Public Member Functions inherited from UnitGroup< state, action, environment >
virtual ~UnitGroup ()
 
virtual bool MakeMove (Unit< state, action, environment > *u, environment *e, SimulationInfo< state, action, environment > *si, action &a)
 
virtual void UpdateLocation (Unit< state, action, environment > *u, environment *e, state &loc, bool success, SimulationInfo< state, action, environment > *si)
 
void AddUnit (Unit< state, action, environment > *u)
 
void RemoveUnit (Unit< state, action, environment > *u)
 
virtual void OpenGLDraw (const environment *, const SimulationInfo< state, action, environment > *) const
 
virtual std::vector< Unit< state, action, environment > * > GetMembers ()
 
unsigned int GetNumMembers ()
 
Unit< state, action, environment > * GetMember (int which) const
 
- Public Member Functions inherited from MapProvider
virtual ~MapProvider ()
 

Protected Attributes

MapAbstraction * aMap
 
Mapmap
 
BitVectorseen
 
int visRadius
 
bool sawNewLand
 
int newTileCount
 
int newTileCountPerTrial
 

Detailed Description

A group which incrementally builds a map of the world as the units in the group explore the Graph.

Definition at line 26 of file SharedAMapGroup.h.

Constructor & Destructor Documentation

◆ SharedAMapGroup()

SharedAMapGroup::SharedAMapGroup ( MapProvider mp)

◆ ~SharedAMapGroup()

SharedAMapGroup::~SharedAMapGroup ( )

Definition at line 36 of file SharedAMapGroup.cpp.

References aMap, and seen.

Member Function Documentation

◆ Done()

bool SharedAMapGroup::Done ( )
virtual

Is the group done with their exploration?

Reimplemented from UnitGroup< state, action, environment >.

Definition at line 137 of file SharedAMapGroup.cpp.

References sawNewLand.

◆ Explored() [1/2]

bool SharedAMapGroup::Explored ( int  x,
int  y 
)

Definition at line 173 of file SharedAMapGroup.cpp.

References BitVector::Get(), Map::GetMapWidth(), map, and seen.

Referenced by Explored().

◆ Explored() [2/2]

bool SharedAMapGroup::Explored ( unsigned int  _node)

Definition at line 178 of file SharedAMapGroup.cpp.

References aMap, Explored(), and GraphAbstractionConstants::kFirstData.

◆ GetMap()

Map * SharedAMapGroup::GetMap ( ) const
virtual

Implements MapProvider.

Definition at line 131 of file SharedAMapGroup.cpp.

References map.

◆ GetMapAbstraction()

MapAbstraction * SharedAMapGroup::GetMapAbstraction ( )
virtual

Implements MapProvider.

Definition at line 126 of file SharedAMapGroup.cpp.

References aMap.

◆ GetName()

virtual const char* SharedAMapGroup::GetName ( )
inlinevirtual

Reimplemented from UnitGroup< state, action, environment >.

Definition at line 30 of file SharedAMapGroup.h.

Referenced by LogStats(), and StartNewTrial().

◆ GetNewTileCount()

virtual int SharedAMapGroup::GetNewTileCount ( )
inlinevirtual

Definition at line 35 of file SharedAMapGroup.h.

References newTileCountPerTrial.

◆ GetNewTileCountPerStep()

int SharedAMapGroup::GetNewTileCountPerStep ( )
inline

Definition at line 52 of file SharedAMapGroup.h.

References newTileCount.

◆ GetVisibilityRadius()

int SharedAMapGroup::GetVisibilityRadius ( )

Definition at line 168 of file SharedAMapGroup.cpp.

References visRadius.

◆ LogStats()

void SharedAMapGroup::LogStats ( StatCollection stats)

◆ OpenGLDraw()

void SharedAMapGroup::OpenGLDraw ( const AbsMapEnvironment *  ,
const AbsMapSimulationInfo  
) const
virtual

◆ SeenBefore()

bool SharedAMapGroup::SeenBefore ( int  x,
int  y 
)
inline

Definition at line 53 of file SharedAMapGroup.h.

References BitVector::Get(), Map::GetMapWidth(), map, and seen.

◆ SetVisibilityRadius()

void SharedAMapGroup::SetVisibilityRadius ( int  _visibility)

Definition at line 163 of file SharedAMapGroup.cpp.

References visRadius.

◆ StartNewTrial()

void SharedAMapGroup::StartNewTrial ( StatCollection stats)
virtual

Lets the unit group do what it needs to reset a trial.

Reimplemented from UnitGroup< state, action, environment >.

Definition at line 155 of file SharedAMapGroup.cpp.

References StatCollection::AddStat(), GetName(), newTileCount, newTileCountPerTrial, and sawNewLand.

◆ UpdateLocation()

void SharedAMapGroup::UpdateLocation ( Unit< xyLoc, tDirection, AbsMapEnvironment > *  u,
AbsMapEnvironment *  mp,
xyLoc loc,
bool  success,
AbsMapSimulationInfo si 
)

Member Data Documentation

◆ aMap

MapAbstraction* SharedAMapGroup::aMap
protected

◆ map

Map* SharedAMapGroup::map
protected

◆ newTileCount

int SharedAMapGroup::newTileCount
protected

◆ newTileCountPerTrial

int SharedAMapGroup::newTileCountPerTrial
protected

Definition at line 64 of file SharedAMapGroup.h.

Referenced by GetNewTileCount(), LogStats(), SharedAMapGroup(), and StartNewTrial().

◆ sawNewLand

bool SharedAMapGroup::sawNewLand
protected

Definition at line 62 of file SharedAMapGroup.h.

Referenced by Done(), SharedAMapGroup(), StartNewTrial(), and UpdateLocation().

◆ seen

BitVector* SharedAMapGroup::seen
protected

◆ visRadius

int SharedAMapGroup::visRadius
protected

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