creativity  v1.3.0
Agent-based model of creativity and piracy
Public Member Functions | Public Attributes | List of all members
creativity::state::State Class Referencefinal

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, ReaderStatereaders
 The readers at the given state.
 
std::map< eris::eris_id_t, BookStatebooks
 The books at the given state.
 
std::unique_ptr< PublicTrackerStatepublictracker
 The public tracker, if it exists.
 

Detailed Description

Class storing the state of the simulation at the end of a simulation period.

Constructor & Destructor Documentation

§ State()

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).

Member Data Documentation

§ boundary

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.

§ dimensions

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.


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