A StateGrid describes a map of grid positions to the current state of each position.
More...
#include <StateGrid.h>
|
| StateGrid () |
|
| StateGrid (StateGridInfo &_i, size_t _w=1, size_t _h=1, int init_val=0) |
|
| StateGrid (StateGridInfo &_i, const std::string &filename) |
|
| StateGrid (const StateGrid &)=default |
|
| StateGrid (StateGrid &&in)=default |
|
| ~StateGrid () |
|
StateGrid & | operator= (const StateGrid &)=default |
|
StateGrid & | operator= (StateGrid &&)=default |
|
size_t | GetWidth () const |
|
size_t | GetHeight () const |
|
size_t | GetSize () const |
|
const emp::vector< int > | GetStates () const |
|
const StateGridInfo & | GetInfo () const |
|
int & | operator() (size_t x, size_t y) |
|
int | operator() (size_t x, size_t y) const |
|
int | GetState (size_t x, size_t y) const |
|
int | GetState (size_t id) const |
|
StateGrid & | SetState (size_t x, size_t y, int in) |
|
char | GetSymbol (size_t x, size_t y) const |
|
double | GetScoreChange (size_t x, size_t y) const |
|
const std::string & | GetName (size_t x, size_t y) const |
|
emp::BitVector | IsState (int target_state) |
| Return a BitVector indicating which positions in the state grid have a particular state. More...
|
|
template<typename... Ts> |
void | AddState (Ts &&...args) |
| Setup the StateGridInfo with possible states. More...
|
|
template<typename... Ts> |
StateGrid & | Load (Ts &&...args) |
| Load in the contents of a StateGrid using the file information provided. More...
|
|
template<typename... Ts> |
const StateGrid & | Print (std::ostream &os=std::cout) const |
| Print the current status of the StateGrid to an output stream. More...
|
|
template<typename... Ts> |
const StateGrid & | Write (Ts &&...args) const |
| Store the current status of the StateGrid to a file. More...
|
|
A StateGrid describes a map of grid positions to the current state of each position.
emp::StateGrid::StateGrid |
( |
| ) |
|
|
inline |
emp::StateGrid::StateGrid |
( |
StateGridInfo & |
_i, |
|
|
size_t |
_w = 1 , |
|
|
size_t |
_h = 1 , |
|
|
int |
init_val = 0 |
|
) |
| |
|
inline |
emp::StateGrid::StateGrid |
( |
StateGridInfo & |
_i, |
|
|
const std::string & |
filename |
|
) |
| |
|
inline |
emp::StateGrid::StateGrid |
( |
const StateGrid & |
| ) |
|
|
default |
emp::StateGrid::~StateGrid |
( |
| ) |
|
|
inline |
template<typename... Ts>
void emp::StateGrid::AddState |
( |
Ts &&... |
args | ) |
|
|
inline |
size_t emp::StateGrid::GetHeight |
( |
| ) |
const |
|
inline |
const std::string& emp::StateGrid::GetName |
( |
size_t |
x, |
|
|
size_t |
y |
|
) |
| const |
|
inline |
double emp::StateGrid::GetScoreChange |
( |
size_t |
x, |
|
|
size_t |
y |
|
) |
| const |
|
inline |
size_t emp::StateGrid::GetSize |
( |
| ) |
const |
|
inline |
int emp::StateGrid::GetState |
( |
size_t |
x, |
|
|
size_t |
y |
|
) |
| const |
|
inline |
int emp::StateGrid::GetState |
( |
size_t |
id | ) |
const |
|
inline |
const emp::vector<int> emp::StateGrid::GetStates |
( |
| ) |
const |
|
inline |
char emp::StateGrid::GetSymbol |
( |
size_t |
x, |
|
|
size_t |
y |
|
) |
| const |
|
inline |
size_t emp::StateGrid::GetWidth |
( |
| ) |
const |
|
inline |
Return a BitVector indicating which positions in the state grid have a particular state.
template<typename... Ts>
StateGrid& emp::StateGrid::Load |
( |
Ts &&... |
args | ) |
|
|
inline |
Load in the contents of a StateGrid using the file information provided.
int& emp::StateGrid::operator() |
( |
size_t |
x, |
|
|
size_t |
y |
|
) |
| |
|
inline |
int emp::StateGrid::operator() |
( |
size_t |
x, |
|
|
size_t |
y |
|
) |
| const |
|
inline |
template<typename... Ts>
const StateGrid& emp::StateGrid::Print |
( |
std::ostream & |
os = std::cout | ) |
const |
|
inline |
Print the current status of the StateGrid to an output stream.
StateGrid& emp::StateGrid::SetState |
( |
size_t |
x, |
|
|
size_t |
y, |
|
|
int |
in |
|
) |
| |
|
inline |
template<typename... Ts>
const StateGrid& emp::StateGrid::Write |
( |
Ts &&... |
args | ) |
const |
|
inline |
Store the current status of the StateGrid to a file.
size_t emp::StateGrid::height |
|
protected |
Height of the overall grid.
Information about the set of states used in this grid.
Specific states at each position in the grid.
size_t emp::StateGrid::width |
|
protected |
Width of the overall grid.
The documentation for this class was generated from the following file: