Utopia  2
Framework for studying models of complex & adaptive systems.
Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
Utopia::Models::SEIRD::Counters< Counter > Struct Template Reference

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

Detailed Description

template<class Counter>
struct Utopia::Models::SEIRD::Counters< Counter >

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.

Constructor & Destructor Documentation

◆ Counters()

template<class Counter >
Utopia::Models::SEIRD::Counters< Counter >::Counters ( )
inline

Counstruct a Counters object with all counts set to zero.

Member Function Documentation

◆ counts()

template<class Counter >
auto Utopia::Models::SEIRD::Counters< Counter >::counts ( )
inline

Return a copy of the current value of all counts.

◆ increment_empty_to_susceptible()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_empty_to_susceptible ( )
inline

Increment counter for transitions from empty to susceptible.

◆ increment_exposed_to_infected()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_exposed_to_infected ( )
inline

Increment counter for transitions from exposed to infected.

◆ increment_infected_to_deceased()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_infected_to_deceased ( )
inline

Increment counter for transitions from infected to deceased.

◆ increment_infected_to_recovered()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_infected_to_recovered ( )
inline

Increment counter for transitions from infected to recovered.

◆ increment_living_to_empty()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_living_to_empty ( )
inline

Increment counter for transitions from living to empty.

◆ increment_move_away_from_infected()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_move_away_from_infected ( )
inline

Increment counter for movement events away from an infected agent.

◆ increment_move_randomly()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_move_randomly ( )
inline

Increment counter for random movement events.

◆ increment_recovered_to_susceptible()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_recovered_to_susceptible ( )
inline

Increment counter for transitions from recovered to susceptible.

◆ increment_susceptible_to_exposed_contact()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_susceptible_to_exposed_contact ( )
inline

Increment counter for transitions from susceptible to exposed (contact)

◆ increment_susceptible_to_exposed_controlled()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_susceptible_to_exposed_controlled ( )
inline

Increment counter for transitions from susceptible to exposed (control)

◆ increment_susceptible_to_exposed_random()

template<class Counter >
void Utopia::Models::SEIRD::Counters< Counter >::increment_susceptible_to_exposed_random ( )
inline

Increment counter for transitions from susceptible to exposed (random)

◆ labels()

template<class Counter >
const auto& Utopia::Models::SEIRD::Counters< Counter >::labels ( )
inline

The labels cooresponding to each entry of the counts array.

Member Data Documentation

◆ _counts

template<class Counter >
std::array<Counter, size> Utopia::Models::SEIRD::Counters< Counter >::_counts {}
private

The array holding the counter values.

◆ _labels

template<class Counter >
const std::array<std::string, size> Utopia::Models::SEIRD::Counters< Counter >::_labels
inlinestaticprivate
Initial value:
{
"empty_to_susceptible",
"living_to_empty",
"susceptible_to_exposed_contact",
"susceptible_to_exposed_random",
"susceptible_to_exposed_controlled",
"exposed_to_infected",
"infected_to_recovered",
"infected_to_deceased",
"recovered_to_susceptible",
"move_randomly",
"move_away_from_infected"
}

The array holding the corresponding counter labels.

◆ size

template<class Counter >
constexpr std::size_t Utopia::Models::SEIRD::Counters< Counter >::size = 11
staticconstexpr

Number of counters.

\NOTE When adjusting this, make sure to adjust the _labels as well!


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