HOG2
|
A group which incrementally builds a map of the world as the units in the group explore the Graph. More...
#include <SharedAMapGroup.h>
Public Member Functions | |
SharedAMapGroup (MapProvider *) | |
~SharedAMapGroup () | |
virtual const char * | GetName () |
virtual void | OpenGLDraw (const AbsMapEnvironment *, const AbsMapSimulationInfo *) const |
virtual Map * | GetMap () 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 |
Map * | map |
BitVector * | seen |
int | visRadius |
bool | sawNewLand |
int | newTileCount |
int | newTileCountPerTrial |
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.
SharedAMapGroup::SharedAMapGroup | ( | MapProvider * | mp | ) |
Definition at line 20 of file SharedAMapGroup.cpp.
References aMap, MapProvider::GetMap(), Map::GetMapHeight(), Map::GetMapWidth(), map, newTileCount, newTileCountPerTrial, sawNewLand, seen, and visRadius.
SharedAMapGroup::~SharedAMapGroup | ( | ) |
Definition at line 36 of file SharedAMapGroup.cpp.
|
virtual |
Is the group done with their exploration?
Reimplemented from UnitGroup< state, action, environment >.
Definition at line 137 of file SharedAMapGroup.cpp.
References sawNewLand.
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().
bool SharedAMapGroup::Explored | ( | unsigned int | _node | ) |
Definition at line 178 of file SharedAMapGroup.cpp.
References aMap, Explored(), and GraphAbstractionConstants::kFirstData.
|
virtual |
|
virtual |
|
inlinevirtual |
Reimplemented from UnitGroup< state, action, environment >.
Definition at line 30 of file SharedAMapGroup.h.
Referenced by LogStats(), and StartNewTrial().
|
inlinevirtual |
Definition at line 35 of file SharedAMapGroup.h.
References newTileCountPerTrial.
|
inline |
Definition at line 52 of file SharedAMapGroup.h.
References newTileCount.
int SharedAMapGroup::GetVisibilityRadius | ( | ) |
Definition at line 168 of file SharedAMapGroup.cpp.
References visRadius.
void SharedAMapGroup::LogStats | ( | StatCollection * | stats | ) |
Definition at line 142 of file SharedAMapGroup.cpp.
References GetName(), newTileCount, newTileCountPerTrial, and StatCollection::SumStat().
|
virtual |
Definition at line 102 of file SharedAMapGroup.cpp.
References BitVector::Get(), Map::GetMapHeight(), Map::GetMapWidth(), Map::GetOpenGLCoord(), map, and seen.
|
inline |
Definition at line 53 of file SharedAMapGroup.h.
References BitVector::Get(), Map::GetMapWidth(), map, and seen.
void SharedAMapGroup::SetVisibilityRadius | ( | int | _visibility | ) |
Definition at line 163 of file SharedAMapGroup.cpp.
References visRadius.
|
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.
void SharedAMapGroup::UpdateLocation | ( | Unit< xyLoc, tDirection, AbsMapEnvironment > * | u, |
AbsMapEnvironment * | mp, | ||
xyLoc & | loc, | ||
bool | success, | ||
AbsMapSimulationInfo * | si | ||
) |
reset the location of a given unit
Definition at line 43 of file SharedAMapGroup.cpp.
References Map::AdjacentCorners(), Map::AdjacentEdges(), aMap, Graph::FindEdge(), BitVector::Get(), Unit< state, action, environment >::GetLocation(), Map::GetMapHeight(), Map::GetMapWidth(), Map::GetNodeNum(), Map::GetTerrainType(), kBottomEdge, kBottomLeft, kBottomRight, kLeftEdge, kRightEdge, kTopEdge, kTopLeft, kTopRight, map, newTileCount, sawNewLand, seen, BitVector::Set(), Map::SetTerrainType(), Unit< state, action, environment >::UpdateLocation(), visRadius, xyLoc::x, and xyLoc::y.
|
protected |
Definition at line 58 of file SharedAMapGroup.h.
Referenced by Explored(), GetMapAbstraction(), SharedAMapGroup(), UpdateLocation(), and ~SharedAMapGroup().
|
protected |
Definition at line 59 of file SharedAMapGroup.h.
Referenced by Explored(), GetMap(), OpenGLDraw(), SeenBefore(), SharedAMapGroup(), and UpdateLocation().
|
protected |
Definition at line 63 of file SharedAMapGroup.h.
Referenced by GetNewTileCountPerStep(), LogStats(), SharedAMapGroup(), StartNewTrial(), and UpdateLocation().
|
protected |
Definition at line 64 of file SharedAMapGroup.h.
Referenced by GetNewTileCount(), LogStats(), SharedAMapGroup(), and StartNewTrial().
|
protected |
Definition at line 62 of file SharedAMapGroup.h.
Referenced by Done(), SharedAMapGroup(), StartNewTrial(), and UpdateLocation().
|
protected |
Definition at line 60 of file SharedAMapGroup.h.
Referenced by Explored(), OpenGLDraw(), SeenBefore(), SharedAMapGroup(), UpdateLocation(), and ~SharedAMapGroup().
|
protected |
Definition at line 61 of file SharedAMapGroup.h.
Referenced by GetVisibilityRadius(), SetVisibilityRadius(), SharedAMapGroup(), and UpdateLocation().