creativity
v1.3.0
Agent-based model of creativity and piracy
|
Class storing the state of the simulation at the end of a simulation period. More...
#include <creativity/state/State.hpp>
Public Member Functions | |
State (const std::shared_ptr< eris::Simulation > &sim) | |
Copies the current simulation readers and books into a State snapshot. More... | |
State ()=default | |
Creates an empty state with t=0, no readers, and no books. | |
Public Attributes | |
eris::eris_time_t | t = 0 |
The simulation period represented by this state. | |
double | boundary = std::numeric_limits<double>::quiet_NaN() |
The simulation boundary. More... | |
uint32_t | dimensions = 0 |
The simulation dimensions. More... | |
std::map< eris::eris_id_t, ReaderState > | readers |
The readers at the given state. | |
std::map< eris::eris_id_t, BookState > | books |
The books at the given state. | |
std::unique_ptr< PublicTrackerState > | publictracker |
The public tracker, if it exists. | |
Class storing the state of the simulation at the end of a simulation period.
creativity::state::State::State | ( | const std::shared_ptr< eris::Simulation > & | sim | ) |
Copies the current simulation readers and books into a State snapshot.
Note: this acquires a run lock on the simulation, and so will block if the simulation is currently running (i.e. in another thread).
double creativity::state::State::boundary = std::numeric_limits<double>::quiet_NaN() |
The simulation boundary.
This is inferred from the boundary of the first reader found in the simulation, the first book if there are no readers, and otherwise remains at its default, NaN.
uint32_t creativity::state::State::dimensions = 0 |
The simulation dimensions.
This is inferred from the first reader found in the simulation, the first book if there are no readers, and otherwise the default, 0.