Common data types

The following list explains the nonstandard data types that are used throughout MEmilio.

Data type name

Description

FP

A floating point type. Usually double is used, but for instance in the optimization using optimal control FP is equal to Ipopt::Number, see ODE-based SEAIR-type model and examples/ode_seair_optimization.cpp.

UncertainValue

This data type describes a value sampled from a given distribution. The value is initialized with a given FP and can be (re)sampled with the draw_sample() function.

AgeGroup

A typesafe size_t, i.e. an integer that cannot be confused with other integer types, so operations like assignment, addition etc. only work with other AgeGroups. Derived from mio::Index.

Region

A typesafe size_t, derived from mio::Index.

CustomIndexArray

A contiguous array whose values can be accessed by a multi-index, e.g. a mio::Index with one or more categories. This datatype is, for example, used in the parameter mio::abm::TimeExposedToNoSymptoms making it dependent on mio::abm::VirusVariant and mio::AgeGroup. Its values can then be set for a specific virus_variant and age_group using model.parameters.template get<mio::abm::TimeInfectedSevereToCritical>()[{virus_variant, age_group}].

Populations

Is a mio::CustomIndexArray with mio::UncertainValue<FP> as values. Adds some convenient functions like get_group_total.

TimeSeries

Stores vectors of values at time points. Each time point has a vector of values of the same size with operations like adding time points, retrieving values, exporting to CSV, etc. It’s also used for storing and analyzing simulation results over time.

Graph

A generic graph structure that represents a network of nodes connected by edges. Each node and edge can have associated properties. The graph is used to model geographical regions connected by mobility patterns (e.g., commuting), where each node is represented by its own epidemiological model.

Node

Represents a node in a graph with a unique ID and associated properties.

Edge

Represents a directed connection between two nodes in a graph with associated properties.

EdgeBase, InEdgeBase, OutEdgeBase

Base classes for Edge that define start and end node indices for connections in the graph.

SimulationNode

Represents a simulation in one node of a mobility graph. Contains a simulation model of any type and keeps track of the last state and time point.

MobilityCoefficients

Time-dependent mobility coefficients used to model how populations move between nodes in a graph.

MobilityCoefficientGroup

A collection of time-dependent mobility coefficients that differentiate between various sources of mobility.

MobilityParameters

Parameters that influence mobility between nodes, including coefficients and dynamic nonpharmaceutical interventions (NPIs).

MobilityEdge

Represents mobility between two nodes in a graph. Handles the movement of populations between nodes, tracks mobile populations, and applies mobility returns according to epidemiological models.

ContactMatrix

Time-dependent contact frequencies between groups, derived from DampingMatrixExpression. Models how the contact rates between different age groups change over time due to interventions.

ContactMatrixGroup

A collection of contact matrices that represent different contexts (e.g., home, school, work) whose sum is the total number of contacts, derived from DampingMatrixExpressionGroup.

DampingMatrixExpression

Represents a coefficient-wise matrix expression \(B - D \odot (B - M)\), where \(B\) is a baseline matrix, \(M\) is a minimum matrix, \(D\) is a time-dependent complex damping factor, and \(\odot\) is element wise multiplication. Used as the base for time-dependent contact matrices.

DampingMatrixExpressionGroup

Represents a collection of DampingMatrixExpressions that are summed up. Used for representing multiple sources of contacts or mobility.

GeographicalLocation

Stores coordinates in (Latitude, Longitude) format. Allows for comparisons and realistic distance calculations.

Distance

Represents a distance. Internally, all distances are stored in meters. They can be created from meters or kilometers and they can be exported using both units. See mio::geo::Distance