Utopia
2
Framework for studying models of complex & adaptive systems.
|
A struct holding counters for state transitions and other global counters. More...
#include <counters.hh>
Public Member Functions | |
Counters () | |
Counstruct a Counters object with all counts set to zero. More... | |
auto | counts () |
Return a copy of the current value of all counts. More... | |
const auto & | labels () |
The labels cooresponding to each entry of the counts array. More... | |
void | increment_empty_to_susceptible () |
Increment counter for transitions from empty to susceptible. More... | |
void | increment_living_to_empty () |
Increment counter for transitions from living to empty. More... | |
void | increment_susceptible_to_exposed_contact () |
Increment counter for transitions from susceptible to exposed (contact) More... | |
void | increment_susceptible_to_exposed_random () |
Increment counter for transitions from susceptible to exposed (random) More... | |
void | increment_susceptible_to_exposed_controlled () |
Increment counter for transitions from susceptible to exposed (control) More... | |
void | increment_exposed_to_infected () |
Increment counter for transitions from exposed to infected. More... | |
void | increment_infected_to_recovered () |
Increment counter for transitions from infected to recovered. More... | |
void | increment_infected_to_deceased () |
Increment counter for transitions from infected to deceased. More... | |
void | increment_recovered_to_susceptible () |
Increment counter for transitions from recovered to susceptible. More... | |
void | increment_move_randomly () |
Increment counter for random movement events. More... | |
void | increment_move_away_from_infected () |
Increment counter for movement events away from an infected agent. More... | |
Static Public Attributes | |
static constexpr std::size_t | size = 11 |
Number of counters. More... | |
Private Attributes | |
std::array< Counter, size > | _counts {} |
The array holding the counter values. More... | |
Static Private Attributes | |
static const std::array< std::string, size > | _labels |
The array holding the corresponding counter labels. More... | |
A struct holding counters for state transitions and other global counters.
This struct is meant to count certain events over the time of a simulation run. The individual counters can be incremented via individual methods which increment the values in the underlying array.
The counters implemented here should be understood as cumulative, that's why there is no option to reset them.
|
inline |
Counstruct a Counters object with all counts set to zero.
|
inline |
Return a copy of the current value of all counts.
|
inline |
Increment counter for transitions from empty to susceptible.
|
inline |
Increment counter for transitions from exposed to infected.
|
inline |
Increment counter for transitions from infected to deceased.
|
inline |
Increment counter for transitions from infected to recovered.
|
inline |
Increment counter for transitions from living to empty.
|
inline |
Increment counter for movement events away from an infected agent.
|
inline |
Increment counter for random movement events.
|
inline |
Increment counter for transitions from recovered to susceptible.
|
inline |
Increment counter for transitions from susceptible to exposed (contact)
|
inline |
Increment counter for transitions from susceptible to exposed (control)
|
inline |
Increment counter for transitions from susceptible to exposed (random)
|
inline |
The labels cooresponding to each entry of the counts array.
|
private |
The array holding the counter values.
|
inlinestaticprivate |
The array holding the corresponding counter labels.
|
staticconstexpr |
Number of counters.
\NOTE When adjusting this, make sure to adjust the _labels as well!