Utopia  2
Framework for studying models of complex & adaptive systems.
Classes | Typedefs | Enumerations | Variables
Utopia::Models::SEIRD Namespace Reference

Classes

struct  Counters
 A struct holding counters for state transitions and other global counters. More...
 
struct  ExposureContParams
 Parameters specifying the exposure control. More...
 
struct  ImmunityContParams
 Parameters specifying the immunity control. More...
 
struct  TransmitContParams
 Parameters specifying the transmit control. More...
 
struct  Params
 Parameters of the SEIRD. More...
 
class  SEIRD
 SEIRD model on a grid. More...
 
struct  State
 The full cell struct for the SEIRD model. More...
 

Typedefs

using CDCellTraits = Utopia::CellTraits< State, Update::manual >
 
using CDTypes = ModelTypes<>
 Typehelper to define data types of SEIRD model. More...
 

Enumerations

enum class  Kind : char {
  empty = 0 , susceptible = 1 , exposed = 2 , infected = 3 ,
  recovered = 4 , deceased = 5 , source = 6 , inert = 7 ,
  COUNT = 8
}
 The kind of the cell. More...
 

Variables

const std::map< const std::string, Kindkind_from_string
 Map the Kind name given as a string to the actual Kind. More...
 
const std::map< const Kind, std::string > string_from_kind
 The inverse of the kind_from_string mapping. More...
 
const std::array< std::string, static_cast< char >Kind::COUNT)> kind_names
 The associated string names of each Kind enum entry. More...
 

Typedef Documentation

◆ CDCellTraits

Specifies the type of each cells' state as first template argument and the update mode as second.

See Utopia::CellTraits for more information.

◆ CDTypes

Typehelper to define data types of SEIRD model.

Enumeration Type Documentation

◆ Kind

enum Utopia::Models::SEIRD::Kind : char
strong

The kind of the cell.

Enumerator
empty 

Unoccupied.

susceptible 

Cell represents a susceptible.

exposed 

Cell is exposed to the dease but not yet infected.

infected 

Cell is infected.

recovered 

Cell is recovered.

deceased 

Cell is deceased.

source 

Cell is an infection source: constantly infected, spreading infection.

inert 

Cell does not partake in the dynamics.

COUNT 

The number of kinds (COUNT)

Attention
The COUNT should always be the last member of the enum class to ensure that it reflects the correct number of kinds.

Variable Documentation

◆ kind_from_string

const std::map<const std::string, Kind> Utopia::Models::SEIRD::kind_from_string
Initial value:
{
{"empty", Kind::empty},
{"susceptible", Kind::susceptible},
{"exposed", Kind::exposed},
{"infected", Kind::infected},
{"recovered", Kind::recovered},
{"deceased", Kind::deceased},
{"source", Kind::source},
{"inert", Kind::inert}
}

Map the Kind name given as a string to the actual Kind.

◆ kind_names

const std::array<std::string, static_cast<char>Kind::COUNT)> Utopia::Models::SEIRD::kind_names
Initial value:
=
[](){
auto names = std::array<std::string, static_cast<char>(Kind::COUNT)>{};
for (auto i = 0u; i < static_cast<char>(Kind::COUNT); i++) {
names[i] = string_from_kind.at(static_cast<Kind>(i));
}
return names;
}()
const std::map< const Kind, std::string > string_from_kind
The inverse of the kind_from_string mapping.
Definition: state.hh:56
Kind
The kind of the cell.
Definition: state.hh:16

The associated string names of each Kind enum entry.

The indices of this array correspond to the char value used when writing out data. It thus is a mapping from char to Kind names, which is a mapping that is useful to have on frontend side.

◆ string_from_kind

const std::map<const Kind, std::string> Utopia::Models::SEIRD::string_from_kind
Initial value:
=
[](){
auto sfk = std::map<const Kind, std::string>{};
for (auto i = 0u; i < static_cast<char>(Kind::COUNT); i++) {
const Kind kind = static_cast<Kind>(i);
const auto item =
std::find_if(kind_from_string.begin(), kind_from_string.end(),
[&](const auto& kv){ return kv.second == kind; });
sfk[kind] = item->first;
}
return sfk;
}()
const std::map< const std::string, Kind > kind_from_string
Map the Kind name given as a string to the actual Kind.
Definition: state.hh:42

The inverse of the kind_from_string mapping.

This can be used to retrieve a string corresponding to a certain Kind value