Empirical
|
Information about a particular agent on a state grid. More...
#include <StateGrid.h>
Classes | |
struct | State |
Public Member Functions | |
StateGridStatus () | |
StateGridStatus (const StateGridStatus &)=default | |
StateGridStatus (StateGridStatus &&)=default | |
StateGridStatus & | operator= (const StateGridStatus &)=default |
StateGridStatus & | operator= (StateGridStatus &&)=default |
size_t | GetX () const |
size_t | GetY () const |
size_t | GetFacing () const |
bool | IsAt (size_t x, size_t y) const |
bool | WasAt (size_t x, size_t y) const |
emp::BitVector | GetVisited (const StateGrid &grid) const |
Get a BitVector indicating the full history of which positions this organism has traversed. More... | |
StateGridStatus & | TrackMoves (bool track=true) |
StateGridStatus & | Set (size_t _x, size_t _y, size_t _f) |
StateGridStatus & | SetX (size_t _x) |
StateGridStatus & | SetY (size_t _y) |
StateGridStatus & | SetPos (size_t _x, size_t _y) |
StateGridStatus & | SetFacing (size_t _f) |
void | Move (const StateGrid &grid, int steps=1) |
Move in the direction currently faced. More... | |
void | Rotate (int turns=1) |
Rotate starting from current facing. More... | |
void | Randomize (const StateGrid &grid, Random &random) |
Move the current status to a random position and orientation. More... | |
int | Scan (const StateGrid &grid) |
Examine state of current position. More... | |
void | SetState (StateGrid &grid, int new_state) |
Set the current position in the state grid. More... | |
void | PrintHistory (StateGrid &grid, std::ostream &os=std::cout) const |
Print the history of an organim moving around a state grid. More... | |
Protected Member Functions | |
void | UpdateHistory () |
If we are tracking moves, store the current position in the history. More... | |
void | MoveX (const StateGrid &grid, int steps=1) |
Move explicitly in the x direction (regardless of facing). More... | |
void | MoveY (const StateGrid &grid, int steps=1) |
Move explicitly in the y direction (regardless of facing). More... | |
Protected Attributes | |
State | cur_state |
Position and facing currently used. More... | |
bool | track_moves |
Should we record every move made by this organism? More... | |
emp::vector< State > | history |
All previous positions and facings in this path. More... | |
Information about a particular agent on a state grid.
|
inline |
|
default |
|
default |
|
inline |
|
inline |
Get a BitVector indicating the full history of which positions this organism has traversed.
|
inline |
|
inline |
|
inline |
|
inline |
Move in the direction currently faced.
|
inlineprotected |
Move explicitly in the x direction (regardless of facing).
|
inlineprotected |
Move explicitly in the y direction (regardless of facing).
|
default |
|
default |
|
inline |
Print the history of an organim moving around a state grid.
Move the current status to a random position and orientation.
|
inline |
Rotate starting from current facing.
|
inline |
Examine state of current position.
|
inline |
|
inline |
|
inline |
|
inline |
Set the current position in the state grid.
|
inline |
|
inline |
|
inline |
|
inlineprotected |
If we are tracking moves, store the current position in the history.
|
inline |
|
protected |
Position and facing currently used.
|
protected |
All previous positions and facings in this path.
|
protected |
Should we record every move made by this organism?