creativity  v1.3.0
Agent-based model of creativity and piracy
State.hpp
1 #pragma once
2 #include <eris/Simulation.hpp>
3 #include "creativity/state/ReaderState.hpp"
4 #include "creativity/state/BookState.hpp"
5 #include "creativity/state/PublicTrackerState.hpp"
6 #include <cstdint>
7 #include <limits>
8 #include <map>
9 
10 namespace creativity {
16 namespace state {
17 
19 class State final {
20  public:
25  State(const std::shared_ptr<eris::Simulation> &sim);
26 
28  State() = default;
29 
31  eris::eris_time_t t = 0;
32 
37  double boundary = std::numeric_limits<double>::quiet_NaN();
38 
42  uint32_t dimensions = 0;
43 
45  std::map<eris::eris_id_t, ReaderState> readers;
46 
48  std::map<eris::eris_id_t, BookState> books;
49 
51  std::unique_ptr<PublicTrackerState> publictracker;
52 };
53 
54 }}
uint32_t dimensions
The simulation dimensions.
Definition: State.hpp:42
Primary namespace for all Creativity library code.
Definition: config.hpp:4
Class storing the state of the simulation at the end of a simulation period.
Definition: State.hpp:19
State()=default
Creates an empty state with t=0, no readers, and no books.
double boundary
The simulation boundary.
Definition: State.hpp:37
std::map< eris::eris_id_t, BookState > books
The books at the given state.
Definition: State.hpp:48
std::unique_ptr< PublicTrackerState > publictracker
The public tracker, if it exists.
Definition: State.hpp:51
eris::eris_time_t t
The simulation period represented by this state.
Definition: State.hpp:31
std::map< eris::eris_id_t, ReaderState > readers
The readers at the given state.
Definition: State.hpp:45