mio Namespace Reference
|
CPP API
|
A collection of classes to simplify handling of matrix shapes in meta programming. More...
Namespaces | |
| abm | |
| dabm | |
| details | |
| geo | |
| glsecir | |
| hybrid | |
| isecir | |
| iseir | |
| lsecir | |
| lsecir2d | |
| mpi | |
| omp | |
| omseirs4 | |
| oseair | |
| osecir | |
| osecirts | |
| osecirvvs | |
| oseir | |
| oseirdb | |
| oseirv | |
| osir | |
| regions | |
| Contains utilities that depend on geographical regions. | |
| smm | |
| sseirvv | |
| ssir | |
| ssirs | |
| timing | |
Classes | |
| class | ABMMobilityEdge |
| Represents the mobility between two nodes. More... | |
| class | ABMSimulationNode |
| Represents the ABM simulation in one node of the ABM graph model. More... | |
| class | AbstractParameterDistribution |
| This class represents an arbitrary ParameterDistribution. More... | |
| struct | AdoptionRate |
| Struct defining a possible status adoption in a Model based on Poisson Processes. More... | |
| struct | AgeGroup |
| The AgeGroup struct is used as a dynamically sized tag for all age dependent categories. More... | |
| struct | back_inserter_second_element |
| Back inserter that ignores the first element of pairs given to it. More... | |
| class | BinarySerializerContext |
| Serializes objects in binary format. More... | |
| class | BinarySerializerObject |
| Stores a binary serialized object. More... | |
| struct | BlendingFactorLocal |
| Blending factor for local ICU occupancy. More... | |
| struct | BlendingFactorRegional |
| Blending factor for regional ICU occupancy. More... | |
| class | ByteStream |
| In-memory stream of bytes. More... | |
| class | ColumnVectorShape |
| shape of a column vector. More... | |
| struct | CompartmentalModel |
| CompartmentalModel is a template for a compartmental model for an array of initial populations and a parameter set. More... | |
| struct | ConstantFunction |
| Class that defines a constant function. More... | |
| struct | ConstVisitor |
| struct | ConstVisitor< T > |
| struct | ConstVisitor< T, Types... > |
| class | ContactMatrix |
| represents time dependent contact frequencies between groups. More... | |
| class | ContactMatrixGroup |
| represents a collection of contact frequency matrices that whose sum is the total number of contacts. More... | |
| struct | ContactReductionMax |
| Maximum allowed contact reduction factors per location. More... | |
| struct | ContactReductionMin |
| Minimum allowed contact reduction factors per location. More... | |
| class | ControlledStepperWrapper |
| This is an adaptive IntegratorCore. More... | |
| class | CustomIndexArray |
| A class template for an array with custom indices. More... | |
| struct | CVPlainMatrix |
| helper to get the matrix type from an eigen expression with correct const volatile qualitfications. More... | |
| struct | CVPlainMatrix< Eigen::Ref< const M > > |
| class | Damping |
| represent interventions or effects that affect contact frequencies between multiple groups. More... | |
| class | DampingMatrixExpression |
| represents the coefficient wise matrix (or vector) expression B - D * M where B is a baseline, M is a minimum and D is some time dependent complex damping factor. More... | |
| class | DampingMatrixExpressionGroup |
| represents a collection of DampingMatrixExpressions that are summed up. More... | |
| class | Dampings |
| collection of dampings at different time points. More... | |
| class | DampingSampling |
| randomly sample dampings for e.g. More... | |
| struct | DataWriterToMemory |
| This class writes data retrieved from loggers to memory. More... | |
| struct | Date |
| Simple date representation as year, month, and day. More... | |
| struct | DefaultFactory |
| Creates an instance of T for later initialization. More... | |
| struct | DefaultFactory< abm::Mask > |
| Creates an instance of abm::Mask for default serialization. More... | |
| struct | DefaultFactory< abm::Person > |
| Creates an instance of abm::Person for default serialization. More... | |
| struct | DefaultFactory< abm::ProtectionEvent > |
| Creates an instance of abm::ProtectionEvent for default serialization. More... | |
| struct | DefaultFactory< abm::Trip > |
| Creates an instance of abm::Trip for default serialization. More... | |
| class | DynamicNPIs |
| represents non-pharmaceutical interventions (NPI) that are activated during the simulation if some value (e.g. More... | |
| struct | Edge |
| represents an edge of the graph More... | |
| struct | EdgeBase |
| struct | ErlangDensity |
| Class that defines the probability density function corresponding to the Erlang distribution with the parameters shape and scale depending on the state age. More... | |
| class | EulerIntegratorCore |
| Simple explicit euler integration y(t+1) = y(t) + h*f(t,y) for ODE y'(t) = f(t,y) More... | |
| class | EulerMaruyamaIntegratorCore |
| Simple explicit integration y(t+1) = y(t) + h*f(t,y) + sqrt(h) * noise_f(t,y) for SDE systems. More... | |
| class | ExplicitStepperWrapper |
| This is a non-adaptive IntegratorCore. More... | |
| struct | ExponentialSurvivalFunction |
| Class that defines the survival function corresponding to the exponential distribution depending on the state age. More... | |
| class | FeedbackGraphSimulation |
| class | FeedbackSimulation |
| A generic feedback simulation extending existing simulations with a feedback mechanism. More... | |
| struct | Flow |
| A Flow defines a possible transition between two Compartments in a FlowModel. More... | |
| class | FlowModel |
| A FlowModel is a CompartmentalModel defined by the flows between compartments. More... | |
| class | FlowSimulation |
| A class for simulating a FlowModel. More... | |
| struct | GammaCutOff |
| Number of days in the past considered for the gamma distribution. More... | |
| struct | GammaScaleParameter |
| Scale parameter of the gamma distribution. More... | |
| struct | GammaShapeParameter |
| Shape parameter of the gamma distribution. More... | |
| struct | GammaSurvivalFunction |
| Class that defines an GammaSurvivalFunction function depending on the state age. More... | |
| class | Graph |
| generic graph structure More... | |
| class | GraphABModel |
| class | GraphBuilder |
| A builder class for constructing graphs. More... | |
| class | GraphSimulation |
| class | GraphSimulationBase |
| abstract simulation on a graph with alternating node and edge actions More... | |
| class | GraphSimulationStochastic |
| struct | has_duplicates |
| Tests whether the list Types contains any type multiple times. More... | |
| class | History |
| History class that handles writers and loggers. More... | |
| struct | ICUOccupancyHistory |
| Daily local ICU occupancy per age group. More... | |
| class | Index |
| An Index with more than one template parameter combines several Index objects. More... | |
| class | Index< CategoryTag > |
| An Index with a single template parameter is a typesafe wrapper for size_t that is associated with a Tag. More... | |
| struct | index_of_type |
| Finds the index of a Type in the list Types. More... | |
| struct | index_of_type< Index< CategoryTags... >, Index< CategoryTags... > > |
| Specialization of index_of_type for Index. Resolves ambiguity when using Indexs as items. More... | |
| struct | index_of_type< Tag, ::mio::Index< CategoryTags... > > |
| Specialization of index_of_type for Index. More... | |
| struct | index_of_type< Type, TypeList< Types... > > |
| Specialization of index_of_type for TypeList. More... | |
| struct | index_of_type< TypeList< Types... >, TypeList< Types... > > |
| Specialization of index_of_type for TypeList. Resolves ambiguity when using TypeLists as items. More... | |
| struct | InEdgeBase |
| struct | Influence |
| Struct defining an influence for a second-order adoption. More... | |
| class | IntegratorCore |
| Interface class defining the integration step used in a SystemIntegrator. More... | |
| class | IOStatus |
| IOStatus represents the result of an operation. More... | |
| struct | is_ad_type |
| Detects whether a type is an automatic differentiation (AD) type. More... | |
| struct | is_ad_type< ad::internal::active_type< Value, Tape > > |
| struct | is_feedback_simulation |
| struct | is_feedback_simulation< FeedbackSimulation< FP, Sim, ContactPatterns > > |
| struct | is_type_in_list |
| Tests whether Type is in the list Types. More... | |
| class | LctInfectionState |
| Provides the functionality to be able to work with subcompartments in an LCT model. More... | |
| class | LctPopulations |
| A class template for compartment populations of LCT models. More... | |
| struct | Limits |
| Type specific limits for floating-points. More... | |
| struct | Limits< ad::internal::active_type< FP, DataHandler > > |
| struct | Limits< double > |
| struct | Limits< float > |
| struct | LogAlways |
| struct | LognormSurvivalFunction |
| Class that defines an LognormSurvivalFunction function depending on the state age. More... | |
| struct | LogOnce |
| LogOnce and LogAlways can be used as a base class to write a logger for History. More... | |
| struct | Members |
| List of a class's members. More... | |
| class | MobilityEdge |
| represents the mobility between two nodes. More... | |
| class | MobilityEdgeStochastic |
| represents the mobility between two nodes. More... | |
| class | MobilityParameters |
| parameters that influence mobility. More... | |
| class | MobilityParametersStochastic |
| parameters that influence mobility. More... | |
| class | MultiIndexIterator |
| A Range that can be used to iterate over a MultiIndex. More... | |
| struct | NamedRef |
| A pair of name and reference. More... | |
| struct | Node |
| represents a node of the graph More... | |
| struct | NoDefaultInit |
| A tag used for tag-dispatching the Constructor of ParameterSet, triggering default initialization of all parameters using the get_default member function. More... | |
| struct | NominalICUCapacity |
| Nominal ICU capacity. More... | |
| class | observer_ptr |
| A non-owning pointer. More... | |
| class | OperatorAdditionSubtraction |
| base class to add default operator +, +=, -, -= to a class derived from TypeSafe. More... | |
| class | OperatorComparison |
| base class to add operator <, <=, >, >= to a class derived from TypeSafe. More... | |
| class | OperatorIncrementDecrement |
| base class to add operator ++, – (pre- and post-) to a class derived from TypeSafe. More... | |
| class | OperatorScalarMultiplicationDivision |
| base class to add operator *, *=, /, /= with a scalar to a class derived from TypeSafe. More... | |
| struct | OutEdgeBase |
| class | ParameterDistribution |
| class | ParameterDistributionConstant |
| class | ParameterDistributionExponential |
| class | ParameterDistributionLogNormal |
| class | ParameterDistributionNormal |
| class | ParameterDistributionUniform |
| class | ParameterSet |
| a set of parameters defined at compile time More... | |
| class | ParameterStudy |
| Class used to perform multiple simulation runs with randomly sampled parameters. More... | |
| struct | ParameterTagTraits |
| the properties of a parameter More... | |
| class | Populations |
| A class template for compartment populations. More... | |
| class | Populations< FP, Index< Categories... > > |
| Population template specialization, forwarding categories from a MultiIndex to the Population. More... | |
| class | Range |
| A range of items defined by two iterators. More... | |
| class | RectMatrixShape |
| shape of a rectangular matrix. More... | |
| class | RKIntegratorCore |
| Two scheme Runge-Kutta numerical integrator with adaptive step width. More... | |
| class | RowMajorIterator |
| iterate over elements of eigen matrix expressions in row major order. More... | |
| struct | Seq |
| sequence of indices More... | |
| class | SerializerBase |
| Base class for implementations of serialization framework concepts. More... | |
| class | Simulation |
| A class for simulating a CompartmentalModel. More... | |
| class | SimulationDay |
| Represents the simulation time as an integer index. More... | |
| class | SimulationNode |
| represents the simulation in one node of the graph. More... | |
| class | SimulationTime |
| double simulation time. More... | |
| struct | SmootherCosine |
| Class that defines an smoother_cosine function depending on the state age. More... | |
| struct | SoftPlusCurvatureParameter |
| Soft-plus curvature parameter for contact adjustment. More... | |
| class | Span |
| a reference to any contigiuous array of objects. More... | |
| class | SquareMatrixShape |
| shape of a square matrix. More... | |
| struct | StateAgeFunction |
| A generic function depending on the state age, i.e. More... | |
| struct | StateAgeFunctionWrapper |
| Wrapper around StateAgeFunction so that one can work with an arbitrary StateAgeFunction. More... | |
| class | StochasticModel |
| A CompartmentalModel with an additional get_noise member. More... | |
| class | StochasticSimulation |
| A class for simulating a StochasticModel. More... | |
| struct | StringLiteral |
| Wrapper for string literals, that allows passing them as template arguments. Should be used with constexpr. More... | |
| class | SystemIntegrator |
| Integrate a system of equations over time. More... | |
| class | Tableau |
| Two scheme Runge-Kutta numerical integrator with adaptive step width for ODE y'(t) = f(t,y) which is given by y_{n+1} = y_n + h*\sum_{i=1}^lb_ik_{ni} with k_{ni} = f(t_n + c_i*h, y_n + h*\sum_{j=1}^{i-1}a_{ij}k_{nj}) where the general Butcher tableau is 0 | c_2 | a_{21} c_3 | a_{31} a_{32} ... More... | |
| class | TableauFinal |
| class | TimeSeries |
| stores vectors of values at time points (or some other abstract variable) the value at each time point is a vector. More... | |
| class | TimeSeriesFunctor |
| class | TimeSeriesTimeIterator |
| Iterate over vector values of a time series by time point. More... | |
| class | TimeSeriesValueIterator |
| Iterate over vector values of a time series by time point. More... | |
| struct | type_at_index |
| Finds the type at the Index-th position in the list Types. More... | |
| struct | type_at_index< Index, TypeList< Types... > > |
| Specialization of type_at_index for TypeList. More... | |
| struct | type_at_index< Tag, ::mio::Index< CategoryTags... > > |
| Specialization of type_at_index for Index. More... | |
| struct | TypeList |
| Collection of types. Each type is mapped to an index of type size_t. More... | |
| class | TypeSafe |
| typesafe wrapper around any type to make function arguments, tuple elements, etc. More... | |
| class | UncertainContactMatrix |
| The UncertainContactMatrix class consists of a ContactMatrix with fixed baseline and uncertain Dampings. More... | |
| class | UncertainValue |
| The UncertainValue class consists of a scalar value and a Distribution object. More... | |
| struct | Visitable |
| struct | Visitor |
| A generic visitor inspired by Fedor Pikus. More... | |
| struct | Visitor< T > |
| struct | Visitor< T, Types... > |
Typedefs | |
| using | ConstParameterDistributionVisitor = ConstVisitor< class ParameterDistributionNormal, class ParameterDistributionUniform, class ParameterDistributionLogNormal, class ParameterDistributionExponential, class ParameterDistributionConstant > |
| template<class M > | |
| using | CVPlainMatrixT = typename CVPlainMatrix< M >::Type |
| template<typename FP > | |
| using | DefaultIntegratorCore = mio::ControlledStepperWrapper< FP, boost::numeric::odeint::runge_kutta_cash_karp54 > |
| The default integrator used by Simulation. More... | |
| template<typename FP > | |
| using | DerivFunction = std::function< void(Eigen::Ref< const Eigen::VectorX< FP > > y, FP t, Eigen::Ref< Eigen::VectorX< FP > > dydt)> |
| Function template to be integrated. More... | |
| template<typename FP > | |
| using | FeedbackSimulationParameters = ParameterSet< ICUOccupancyHistory< FP >, GammaShapeParameter< FP >, GammaScaleParameter< FP >, GammaCutOff, ContactReductionMax< FP >, ContactReductionMin< FP >, SoftPlusCurvatureParameter< FP >, NominalICUCapacity< FP >, BlendingFactorLocal< FP >, BlendingFactorRegional< FP > > |
| template<class T , class... Args> | |
| using | has_get_default_member_function = details::has_get_default_member_function< T, void, Args... > |
| check whether a get_default function exists More... | |
| template<class... Loggers> | |
| using | HistoryWithMemoryWriter = History< DataWriterToMemory, Loggers... > |
| template<class T > | |
| using | InterpolateResultT = std::decay_t< decltype(interpolate_simulation_result(std::declval< T >()))> |
| helper template, type returned by overload interpolate_simulation_result(T t) More... | |
| template<class T > | |
| using | IOResult = boost::outcome_v2::unchecked< T, IOStatus > |
| Value-or-error type for operations that return a value but can fail. More... | |
| template<class T > | |
| using | is_64bit_integral = std::integral_constant< bool,(std::is_integral_v< T > &&sizeof(T)==8)> |
| Bool constant to check whether T is an integral type of 64 bits. Used for Json library. More... | |
| template<typename T > | |
| using | is_no_default_init_tag = std::is_same< NoDefaultInit, T > |
| template<class T > | |
| using | is_small_integral = std::integral_constant< bool,(std::is_integral_v< T > &&sizeof(T)<=4)> |
| Bool constant to check whether T is an integral type of 32 bits or less. Used for Json library. More... | |
| template<typename FP > | |
| using | MobilityCoefficientGroup = DampingMatrixExpressionGroup< FP, MobilityCoefficients< FP > > |
| sum of time dependent mobility coefficients. More... | |
| template<typename FP > | |
| using | MobilityCoefficients = DampingMatrixExpression< FP, VectorDampings< FP > > |
| time dependent mobility coefficients. More... | |
| template<bool Cond> | |
| using | not_copyable_if = std::conditional< Cond, details::NoCopy, details::Empty > |
| Defines a type that is not copy constructible or assignable if the specified condition is true. More... | |
| template<bool Cond> | |
| using | not_copyable_if_t = typename not_copyable_if< Cond >::type |
| equivalent to not_copyable_if<Cond>::type. More... | |
| template<typename FP > | |
| using | OdeIntegrator = SystemIntegrator< FP, DerivFunction< FP > > |
| Solver for a system of initial value problems (IVPs) consisting of ordinary differential equations (ODEs). More... | |
| template<class FP > | |
| using | OdeIntegratorCore = IntegratorCore< FP, DerivFunction< FP > > |
| Interface for defining solvers for ODE problems. Also. More... | |
| using | ParameterDistributionVisitor = Visitor< class ParameterDistributionNormal, class ParameterDistributionUniform, class ParameterDistributionLogNormal, class ParameterDistributionExponential, class ParameterDistributionConstant > |
| This is a visitor class to visit all Parameter Distribution objects. More... | |
| template<size_t I, class ParamSet > | |
| using | ParameterTag = details::ParameterTag< I, ParamSet > |
| get the the tag of the I-th parameter in a set More... | |
| template<size_t I, class ParamSet > | |
| using | ParameterTagT = typename ParameterTag< I, ParamSet >::Type |
| template<typename FP > | |
| using | SdeIntegrator = SystemIntegrator< FP, DerivFunction< FP >, DerivFunction< FP > > |
| Solver for a system of initial value problems (IVPs) consisting of stochastic differential equations (SDEs). More... | |
| template<class FP > | |
| using | SdeIntegratorCore = IntegratorCore< FP, DerivFunction< FP >, DerivFunction< FP > > |
| Interface for defining solvers for SDE problems. Also. More... | |
| template<typename FP > | |
| using | SquareDamping = Damping< FP, SquareMatrixShape< FP > > |
| aliases for common damping specializations. More... | |
| template<typename FP > | |
| using | SquareDampings = Dampings< FP, SquareDamping< FP > > |
| template<class T > | |
| using | Tag = boost::outcome_v2::in_place_type_t< T > |
| Type that is used for overload resolution. More... | |
| template<std::size_t Index, class... Types> | |
| using | type_at_index_t = typename type_at_index< Index, Types... >::type |
| The type at the Index-th position in the list Types. More... | |
| template<typename FP > | |
| using | VectorDamping = Damping< FP, ColumnVectorShape< FP > > |
| template<typename FP > | |
| using | VectorDampings = Dampings< FP, VectorDamping< FP > > |
| template<class T > | |
| using | VectorRange = std::conditional_t< std::is_const_v< T >, typename mio::Range< typename std::vector< std::remove_const_t< T > >::const_iterator >, typename mio::Range< typename std::vector< std::remove_const_t< T > >::iterator > > |
| Defines generic Range type for IterPair of a vector. More... | |
| template<class Derived > | |
| using | VisitableParameterDistribution = Visitable< Derived, class ParameterDistribution, ParameterDistributionVisitor, ConstParameterDistributionVisitor > |
Enumerations | |
| enum | IOFlags { IOF_None = 0 , IOF_OmitDistributions = 1 << 0 , IOF_OmitValues = 1 << 1 , IOF_IncludeTypeInfo = 1 << 2 } |
| flags to determine the behavior of the serialization process. More... | |
| enum class | LogLevel { trace , debug , info , warn , err , critical , off } |
| enum class | StatusCode { OK = 0 , UnknownError = 1 , OutOfRange , InvalidValue , InvalidFileFormat , KeyNotFound , InvalidType , FileNotFound } |
| code to indicate the result of an operation. More... | |
| enum class | TimeSeriesFunctorType { LinearInterpolation } |
| Type of a TimeSeriesFunctor. More... | |
Functions | |
| template<typename FP > | |
| FP | abs_max (FP v1, FP v2) |
| maximum absolute value of two numbers. More... | |
| obj | add_list ("Items", container.begin(), container.end()) |
| template<class... History> | |
| void | advance_model (abm::TimePoint t, abm::TimeSpan dt, ABMSimulationNode< History... > &node) |
| Node functor for abm graph simulation. More... | |
| template<typename FP , class Sim > | |
| void | advance_model (FP t, FP dt, SimulationNode< FP, Sim > &node) |
| edge functor for mobility-based simulation. More... | |
| return | apply (io, [](auto &&i_) { return Container(i_.begin(), i_.end());}, i) |
| template<class DampingExpression , class DampingSamplings , class F > | |
| void | apply_dampings (DampingExpression &damping_expression, const DampingSamplings &dampings, F make_matrix) |
| add sampled dampings to a damping expression. More... | |
| template<class... History> | |
| void | apply_mobility (abm::TimePoint t, abm::TimeSpan, ABMMobilityEdge< History... > &edge, ABMSimulationNode< History... > &node_from, ABMSimulationNode< History... > &node_to) |
| Edge functor for abm graph simulation. More... | |
| template<typename FP , class Sim > | |
| void | apply_mobility (FP t, FP dt, MobilityEdge< FP > &mobilityEdge, SimulationNode< FP, Sim > &node_from, SimulationNode< FP, Sim > &node_to) |
| edge functor for mobility-based simulation. More... | |
| template<typename FP , class Sim , class StochasticEdge > | |
| void | apply_mobility (StochasticEdge &mobilityEdge, size_t event, SimulationNode< FP, Sim > &node_from, SimulationNode< FP, Sim > &node_to) |
| edge functor for mobility-based simulation. More... | |
| static const std::string | base_dir () |
| Returns the absolute path to the project directory. More... | |
| template<IsMatrixExpression M> | |
| RowMajorIterator< M, true > | begin (const M &m) |
| create a const iterator to first element of the matrix m. More... | |
| template<class... Categories> | |
| MultiIndexIterator< Index< Categories... > > | begin (Index< Categories... > dimensions) |
| STL iterator for a MultiIndex. More... | |
| template<IsMatrixExpression M> | |
| requires details::IsElementReference< M > RowMajorIterator< M, false > | begin (M &m) |
| create a non-const iterator to first element of the matrix m. More... | |
| template<typename FP , IsCompartmentalModelSimulation< FP > Sim> | |
| void | calculate_mobility_returns (Eigen::Ref< typename TimeSeries< FP >::Vector > mobile_population, const Sim &sim, Eigen::Ref< const typename TimeSeries< FP >::Vector > total, FP t, FP dt) |
| adjust number of people that changed node when they return according to the model. More... | |
| std::array< int, 12 > | calculate_partial_sum_of_months (const Date &date) |
| Computes the cumulative number of days at the end of each month for a given year. More... | |
| template<IsMatrixExpression M> | |
| RowMajorIterator< M, true > | cbegin (const M &m) |
| create a const iterator to first element of the matrix m. More... | |
| template<IsMatrixExpression M> | |
| RowMajorIterator< M, true > | cend (const M &m) |
| create a non-const end iterator for the matrix m. More... | |
| template<class... IndexArgs> | |
| decltype(auto) | concatenate_indices (IndexArgs &&... args) |
| Combine several Indexs into one MultiIndex. More... | |
| template<class Iter , class Pred > | |
| bool | contains (Iter b, Iter e, Pred p) |
| checks if there is an element in this range that matches a predicate More... | |
| IOResult< int > | count_lines (const std::string &filename) |
| Counts lines of txt file. More... | |
| IOResult< bool > | create_directory (std::string const &rel_path) |
| Creates a directory in the file system. More... | |
| IOResult< bool > | create_directory (std::string const &rel_path, std::string &abs_path) |
| Creates a directory in the file system. More... | |
| DECL_TYPESAFE (int, DampingLevel) | |
| integer damping level. More... | |
| DECL_TYPESAFE (int, DampingType) | |
| integer damping type. More... | |
| template<class IOContext , class T > | |
| IOResult< T > | deserialize (IOContext &io, Tag< T > tag) |
| Restores an object from the data stored in an IO context. More... | |
| template<class T > | |
| IOResult< T > | deserialize_binary (ByteStream &stream, Tag< T >, int flags=0) |
| Deserialize an object from binary format. More... | |
| template<class IOContext > | |
| IOResult< AbstractParameterDistribution > | deserialize_internal (IOContext &io, Tag< AbstractParameterDistribution >) |
| deserialize a AbstractParameterDistribution. More... | |
| template<class IOContext , class E > | |
| requires std::is_enum_v< E > IOResult< E > | deserialize_internal (IOContext &io, Tag< E >) |
| deserialize an enum value from its underlying type. More... | |
| template<class IOContext , IsMatrixExpression M> | |
| IOResult< M > | deserialize_internal (IOContext &io, Tag< M >) |
| deserialize an Eigen matrix. More... | |
| template<class IOContext , size_t N> | |
| IOResult< std::bitset< N > > | deserialize_internal (IOContext &io, Tag< std::bitset< N >> tag) |
| Deserialize an std::bitset. More... | |
| template<class IOContext > | |
| IOResult< std::shared_ptr< ParameterDistribution > > | deserialize_internal (IOContext &io, Tag< std::shared_ptr< ParameterDistribution >>) |
| deserialize a parameter distribution as a shared_ptr. More... | |
| template<class IOContext , IsDefaultDeserializable< IOContext > T> | |
| IOResult< T > | deserialize_internal (IOContext &io, Tag< T > tag) |
| Deserialization implementation for the default serialization feature. More... | |
| template<class IOContext , template< class... > class Tup, class... T> | |
| requires std::same_as< Tup< T... >, std::pair< T... > > std::same_as< Tup< T... >, std::tuple< T... > > IOResult< Tup< T... > > | deserialize_internal (IOContext &io, Tag< Tup< T... >> tag) |
| deserialize a tuple-like object, e.g. More... | |
| template<class U , class T > | |
| std::unique_ptr< U > | dynamic_unique_ptr_cast (std::unique_ptr< T > &&base_ptr) |
| converts a unique_ptr<T> to unique_ptr. More... | |
| template<IsMatrixExpression M> | |
| RowMajorIterator< M, true > | end (const M &m) |
| create a const end iterator for the matrix m. More... | |
| template<class... Categories> | |
| MultiIndexIterator< Index< Categories... > > | end (Index< Categories... > dimensions) |
| STL iterator for a MultiIndex. More... | |
| template<IsMatrixExpression M> | |
| requires details::IsElementReference< M > RowMajorIterator< M, false > | end (M &m) |
| create a non-const end iterator for the matrix m. More... | |
| template<typename FP > | |
| std::vector< TimeSeries< FP > > | ensemble_mean (const std::vector< std::vector< TimeSeries< FP >>> &ensemble_results) |
| computes mean of each compartment, node, and time point over all runs input must be uniform as returned by interpolated_ensemble_result: same number of nodes, same time points and elements. More... | |
| template<typename FP > | |
| std::vector< TimeSeries< FP > > | ensemble_percentile (const std::vector< std::vector< TimeSeries< FP >>> &ensemble_result, FP p) |
| computes the p percentile of the result for each compartment, node, and time point. More... | |
| template<class T > | |
| constexpr std::array< T, size_t(T::Count)> | enum_members () |
| Get an std::array that contains all members of an enum class. More... | |
| template<typename Type , typename Intermediate > | |
| auto | evaluate_intermediate (Intermediate &&x) |
| Evaluate an intermediate expression to its underlying type, if necessary. More... | |
| template<class SuperIndex , class SubIndex > | |
| SuperIndex | extend_index (const SubIndex &index, size_t fill_value=0) |
| Create a SuperIndex by copying values from SubIndex, filling new categories with fill_value. More... | |
| auto | failure (const IOStatus &s) |
| Create an object that is implicitly convertible to an error IOResult<T>. More... | |
| auto | failure (std::error_code c, const std::string &msg="") |
| Create an object that is implicitly convertible to an error IOResult<T>. More... | |
| bool | file_exists (std::string const &rel_path, std::string &abs_path) |
| Check if a file exists. More... | |
| template<class FP , class TS > | |
| decltype(std::declval< TS >().rend()) | find_value_reverse (TS &&ts, FP t_search, FP abs_tol=0, FP rel_tol=0) |
| find the value in the time series at time t_search starting from the end. More... | |
| template<typename MultiIndex > | |
| size_t | flatten_index (MultiIndex const &indices, MultiIndex const &dimensions) |
| flatten_index takes a set of indices into a mutlidemsional array and calculates the flat index More... | |
| template<typename FP > | |
| bool | floating_point_equal (FP v1, FP v2, FP abs_tol=0, FP rel_tol=std::numeric_limits< FP >::min()) |
| compare two floating point values for equality with tolerances. More... | |
| template<typename FP > | |
| bool | floating_point_greater (FP v1, FP v2, FP abs_tol=0, FP rel_tol=std::numeric_limits< FP >::min()) |
| compare two floating point values with tolerances. More... | |
| template<typename FP > | |
| bool | floating_point_greater_equal (FP v1, FP v2, FP abs_tol=0, FP rel_tol=std::numeric_limits< FP >::min()) |
| compare two floating point values with tolerances. More... | |
| template<typename FP > | |
| bool | floating_point_less (FP v1, FP v2, FP abs_tol=0, FP rel_tol=std::numeric_limits< FP >::min()) |
| compare two floating point values with tolerances. More... | |
| template<typename FP > | |
| bool | floating_point_less_equal (FP v1, FP v2, FP abs_tol=0, FP rel_tol=std::numeric_limits< FP >::min()) |
| compare two floating point values with tolerances. More... | |
| template<class F , class... Tags> | |
| void | foreach (const ParameterSet< Tags... > &p, F f) |
| call f(p, t) for all parameters in a ParameterSet with p the value of the parameter t a default constructed parameter tag More... | |
| template<class F , class... Tags> | |
| void | foreach (ParameterSet< Tags... > &p, F f) |
| template<class Params , class F > | |
| void | foreach_tag (F f) |
| call f(t) for all parameters in a ParameterSet with t a default constructed parameter tag More... | |
| std::string | format_as (const mio::Date &d) |
| Format date objects using the ISO notation for logging with spdlog. More... | |
| template<class FP > | |
| const FP & | format_as (const UncertainValue< FP > &uv) |
| Format UncertainValues using their value for logging with spdlog. More... | |
| template<size_t I, typename... CategoryTags> | |
| constexpr std::tuple_element< I, std::tuple< Index< CategoryTags >... > >::type & | get (Index< CategoryTags... > &i) noexcept |
| Retrieves the Index (by reference) at the Ith position of a MultiIndex. More... | |
| template<typename Tag , typename... CategoryTags> | |
| constexpr Index< Tag > & | get (Index< CategoryTags... > &i) noexcept |
| Retrieves the Index (by reference) by its Tag in a MultiIndex. Requires unique tags. More... | |
| template<size_t I, typename... CategoryTags> | |
| constexpr std::tuple_element< I, std::tuple< Index< CategoryTags >... > >::type const & | get (Index< CategoryTags... > const &i) noexcept |
| Retrieves the Index (by const reference) at the Ith position of a MultiIndex. More... | |
| template<typename Tag , typename... CategoryTags> | |
| constexpr Index< Tag > const & | get (Index< CategoryTags... > const &i) noexcept |
| Retrieves the Index (by const reference) by its Tag in a MultiIndex. Requires unique tags. More... | |
| template<typename FP , class DampingExpr > | |
| Eigen::Ref< const typename DampingExpr::Matrix > | get_active_damping (const DampingExpr &damping_expr, DampingLevel lvl, DampingType type, SimulationTime< FP > t) |
| Get the value of the damping that matches the given type and level and that is active at the specified time. More... | |
| std::string | get_current_dir_name () |
| Returns the current working directory name. More... | |
| template<typename FP , class DampingExpr > | |
| std::vector< size_t > | get_damping_indices (const DampingExpr &damping_expr, DampingLevel lvl, DampingType type, SimulationTime< FP > begin, SimulationTime< FP > end) |
| Get a list of indices of specified dampings. More... | |
| int | get_day_in_year (Date date) |
| Computes the day in year based on a given date. More... | |
| template<typename FP , class Sim > | |
| FP | get_infections_relative (const SimulationNode< FP, Sim > &node, FP t, const Eigen::Ref< const Eigen::VectorX< FP >> &y) |
| get the percantage of infected people of the total population in the node If dynamic NPIs are enabled, there needs to be an overload of get_infections_relative(model, y) for the Model type that can be found with argument-dependent lookup. More... | |
| template<typename FP , class Sim > | |
| auto | get_mobility_factors (const SimulationNode< FP, Sim > &node, FP t, const Eigen::Ref< const Eigen::VectorX< FP >> &y) |
| Get an additional mobility factor. More... | |
| int | get_month_length (Date date) |
| Computes the length of a month for a given date. More... | |
| int | get_offset_in_days (Date date1, Date date2) |
| Computes the offset in days given two dates: first date minus second date. More... | |
| template<typename FP , class DampingExprGroup , class MakeMatrix > | |
| void | implement_dynamic_npis (DampingExprGroup &damping_expr_group, const std::vector< DampingSampling< FP >> &npis, SimulationTime< FP > begin, SimulationTime< FP > end, MakeMatrix &&make_matrix) |
| implement dynamic NPIs for a time span. More... | |
| template<typename T > | |
| void | insert_sorted_replace (std::vector< T > &vec, T const &item) |
| template<typename T , typename Pred > | |
| void | insert_sorted_replace (std::vector< T > &vec, T const &item, Pred pred) |
| inserts element in a sorted vector, replacing items that are equal precondition: elements in the vector are partially sorted and unique according the predicate postcondition: same as precondition, additionally contains exactly one element that is equal to item, order of other items is preserved More... | |
| template<class T > | |
| std::vector< InterpolateResultT< T > > | interpolate_ensemble_results (const std::vector< T > &ensemble_results) |
| Interpolates results of all runs with evenly spaced, integer time points that represent whole days. More... | |
| template<typename FP , class Simulation > | |
| std::vector< TimeSeries< FP > > | interpolate_simulation_result (const Graph< SimulationNode< FP, Simulation >, MobilityEdge< FP >> &graph_result) |
| interpolate time series with evenly spaced, integer time points for each node. More... | |
| template<typename FP > | |
| TimeSeries< FP > | interpolate_simulation_result (const TimeSeries< FP > &simulation_result, const FP abs_tol=FP{100.} *Limits< FP >::zero_tolerance()) |
| Interpolate a given time series with evenly spaced, integer time points that represent whole days. More... | |
| template<typename FP > | |
| TimeSeries< FP > | interpolate_simulation_result (const TimeSeries< FP > &simulation_result, const std::vector< FP > &interpolation_times) |
| Interpolate a time series at the given time points. More... | |
| bool | is_leap_year (int year) |
| Computes if a given year is a leap year. More... | |
| template<typename X , typename V > | |
| auto | linear_interpolation (const X &x_eval, const X &x_1, const X &x_2, const V &y1, const V &y2) |
| Linear interpolation between two data values. More... | |
| template<class FP > | |
| TimeSeries< FP >::Vector | linear_interpolation (FP time, const TimeSeries< FP > &data) |
| Linear interpolation of a TimeSeries. More... | |
| template<typename X , typename Y > | |
| Y | linear_interpolation_of_data_set (std::vector< std::pair< X, Y >> vector, const X &x_eval) |
| Linear interpolation between two points of a dataset, which is represented by a vector of pairs of node and value. More... | |
| template<typename... Args> | |
| void | log (LogLevel level, spdlog::string_view_t fmt, const Args &... args) |
| template<typename... Args> | |
| void | log_critical (spdlog::string_view_t fmt, const Args &... args) |
| template<typename... Args> | |
| void | log_debug (spdlog::string_view_t fmt, const Args &... args) |
| template<typename... Args> | |
| void | log_error (spdlog::string_view_t fmt, const Args &... args) |
| template<typename... Args> | |
| void | log_info (spdlog::string_view_t fmt, const Args &... args) |
| template<typename... Args> | |
| void | log_warning (spdlog::string_view_t fmt, const Args &... args) |
| template<class M > | |
| Eigen::Index | major_size (M &&m) |
| number of rows (columns) of a row (column) major matrix. More... | |
| template<class... History> | |
| GraphSimulation< ScalarType, Graph< ABMSimulationNode< History... >, ABMMobilityEdge< History... > >, abm::TimePoint, abm::TimeSpan, void(*)(mio::abm::TimePoint, mio::abm::TimeSpan, mio::ABMMobilityEdge< History... > &, mio::ABMSimulationNode< History... > &, mio::ABMSimulationNode< History... > &), void(*)(mio::abm::TimePoint, mio::abm::TimeSpan, mio::ABMSimulationNode< History... > &)> | make_abm_graph_sim (abm::TimePoint t0, abm::TimeSpan dt, Graph< ABMSimulationNode< History... >, ABMMobilityEdge< History... >> &&graph) |
| Creates an abm graph simulation. More... | |
| template<class V > | |
| auto | make_contact_damping_matrix (V &&groups) |
| Make a contact damping matrix from dampings by group. More... | |
| const std::error_code & | make_error_code (const IOStatus &status) |
| Convert IOStatus to std::error_code. More... | |
| std::error_code | make_error_code (StatusCode e) |
| Convert StatusCode to std::error_code. More... | |
| template<typename FP , typename Timepoint , class Timespan , class Graph , class NodeF , class EdgeF > | |
| auto | make_graph_sim (Timepoint t0, Timespan dt, Graph &&g, NodeF &&node_func, EdgeF &&edge_func) |
| template<typename FP , class Graph , class NodeF , class EdgeF > | |
| auto | make_graph_sim_stochastic (FP t0, FP dt, Graph &&g, NodeF &&node_func, EdgeF &&edge_func) |
| template<class... Categories> | |
| Range< MultiIndexIterator< Index< Categories... > > > | make_index_range (Index< Categories... > dimensions) |
| Construct a range that can be used to iterate over all MultiIndices in the given dimensions. More... | |
| template<typename FP , class V > | |
| auto | make_mobility_damping_vector (ColumnVectorShape< FP > shape, V &&groups) |
| Make mobility coefficient damping vector from dampings by group. More... | |
| template<typename T > | |
| observer_ptr< T > | make_observer (T *p) |
| template<typename FP , class Sim > | |
| auto | make_sampled_graph_simulation (const Graph< typename Sim::Model, MobilityParameters< FP >> &sampled_graph, FP t0, FP dt_node_sim, FP dt_graph_sim) |
| Create a GraphSimulation from a parameter graph. More... | |
| template<class Rng , class F > | |
| auto | map (const Rng &v, F f) |
| Maps a random access range (i.e. More... | |
| template<typename FP > | |
| IOResult< void > | map_to_nonnegative (Eigen::Ref< Eigen::VectorX< FP >> x, const FP tolerance=Limits< FP >::zero_tolerance()) |
| Map a vector onto nonnegative values while preserving its nonnegative sum. More... | |
| template<class A , class B > | |
| auto | max (const Eigen::MatrixBase< A > &a, B &&b) |
| coefficient wise maximum of two matrices. More... | |
| template<class FP > | |
| IOResult< TimeSeries< FP > > | merge_time_series (const TimeSeries< FP > &ts1, const TimeSeries< FP > &ts2, bool add_values=false) |
| This function merges two TimeSeries by copying their time points and values to a new TimeSeries in the correct order. More... | |
| template<class M > | |
| Eigen::Index | minor_size (M &&m) |
| number of columns (rows) of a row (column) major matrix. More... | |
| Date | offset_date_by_days (Date date, int offset_days) |
| Computes the new date corresponding to a given date and a offset in days. More... | |
| template<std::equality_comparable T> | |
| bool | operator!= (const Edge< T > &e1, const Edge< T > &e2) |
| template<std::equality_comparable T> | |
| bool | operator!= (const Node< T > &n1, const Node< T > &n2) |
| template<class T > | |
| requires HasOstreamOperator< T > std::ostream & | operator<< (std::ostream &os, const Edge< T > &e) |
| out stream operator for edges if edge property type has stream operator defined More... | |
| template<std::equality_comparable T> | |
| bool | operator== (const Edge< T > &e1, const Edge< T > &e2) |
| comparison operator if edge property type is equality comparable More... | |
| template<std::equality_comparable T> | |
| bool | operator== (const Node< T > &n1, const Node< T > &n2) |
| comparison operator if node property type is equality comparable More... | |
| IOResult< Date > | parse_date (const std::string &date_str) |
| parses a date from a string. More... | |
| template<class String , class... Strings> | |
| std::string | path_join (String &&base, Strings &&... app) |
| join one ore more strings with path separators. More... | |
| template<class Graph > | |
| void | print_graph (std::ostream &os, const Graph &g) |
| template<class T > | |
| requires HasOstreamOperator< T > void | print_graph_object (std::ostream &os, size_t idx, const T &o) |
| void | PrintTo (const IOStatus &status, std::ostream *os) |
| gtest printer for IOStatus. More... | |
| template<typename FP > | |
| void | PrintTo (const UncertainValue< FP > &uv, std::ostream *os) |
| template<class I , class S > | |
| Range (std::pair< I, S > iterator_pair) -> Range< I, S > | |
| Deduction guide to correctly deduce range type when constructed from a pair. More... | |
| template<class T > | |
| Range (T &&range) -> Range< decltype(range.begin()), decltype(range.end())> | |
| Deduction guide to correctly deduce range type when constructed from another range. More... | |
| IOResult< Eigen::MatrixXd > | read_mobility_formatted (const std::string &filename) |
| Reads formatted mobility or contact data which is given in columns from_str to_str from_rs to_rs count_abs and separated by tabs. More... | |
| IOResult< Eigen::MatrixXd > | read_mobility_plain (const std::string &filename) |
| Reads txt mobility data or contact which is given by values only and separated by spaces. More... | |
| template<class T > | |
| requires (!HasOstreamOperator< T >) std | |
| out stream operator for edges if edge property type does not have stream operator defined More... | |
| template<class IOContext , IsContainer Container> | |
| requires (!HasSerialize< IOContext, Container >) void serialize_internal(IOContext &io | |
| serialize an STL compatible container. More... | |
| template<class T > | |
| requires (!std::is_trivial_v< T >) void BinarySerializerObject | |
| template<typename M > | |
| auto | reshape (M &&m, Eigen::Index rows, Eigen::Index cols) |
| reshape the matrix. More... | |
| template<typename FP > | |
| FP | result_distance_2norm (const std::vector< mio::TimeSeries< FP >> &result1, const std::vector< mio::TimeSeries< FP >> &result2) |
| Compute the distance between two SECIR simulation results. More... | |
| template<typename FP , class InfectionState > | |
| FP | result_distance_2norm (const std::vector< mio::TimeSeries< FP >> &result1, const std::vector< mio::TimeSeries< FP >> &result2, InfectionState compartment) |
| Compute the distance between two compartment model simulation results in one compartment. More... | |
| template<class IOContext , class T > | |
| void | serialize (IOContext &io, const T &t) |
| Save data that describes an object in a format determined by the given context. More... | |
| template<class T > | |
| ByteStream | serialize_binary (const T &t, int flags=0) |
| Serialize an object into binary format. More... | |
| template<class IOContext , class M > | |
| void | serialize_internal (IOContext &io, const Eigen::EigenBase< M > &mat) |
| serialize an Eigen matrix expression. More... | |
| template<class IOContext , size_t N> | |
| void | serialize_internal (IOContext &io, const std::bitset< N > bitset) |
| Serialize an std::bitset. More... | |
| template<class IOContext , IsDefaultSerializable< IOContext > T> | |
| void | serialize_internal (IOContext &io, const T &a) |
| Serialization implementation for the default serialization feature. More... | |
| template<class IOContext , template< class... > class Tup, class... T> | |
| requires std::same_as< Tup< T... >, std::pair< T... > > std::same_as< Tup< T... >, std::tuple< T... > > void | serialize_internal (IOContext &io, const Tup< T... > &tup) |
| serialize a tuple-like object, e.g. More... | |
| template<class IOContext , class E > | |
| requires std::is_enum_v< E > void | serialize_internal (IOContext &io, E e) |
| serialize an enum value as its underlying type. More... | |
| template<typename FP , class ContactLocation , class Model , class MobilityParams , class MobilityCoefficientGroup , class InfectionState , class ReadFunction > | |
| IOResult< void > | set_edges (const fs::path &mobility_data_file, Graph< Model, MobilityParams > ¶ms_graph, std::initializer_list< InfectionState > &mobile_compartments, size_t contact_locations_size, ReadFunction &&read_func, std::vector< FP > commuting_weights, std::vector< std::vector< size_t >> indices_of_saved_edges={}) |
| Sets the graph edges. More... | |
| void | set_log_level (LogLevel level) |
| Sets the verbosity of the logger. More... | |
| template<typename FP , class TestAndTrace , class ContactPattern , class Model , class MobilityParams , class Parameters , class ReadFunction , class NodeIdFunction > | |
| IOResult< void > | set_nodes (const Parameters ¶ms, Date start_date, Date end_date, const fs::path &data_dir, const std::string &population_data_path, bool is_node_for_county, Graph< Model, MobilityParams > ¶ms_graph, ReadFunction &&read_func, NodeIdFunction &&node_func, const std::vector< FP > &scaling_factor_inf, FP scaling_factor_icu, FP tnt_capacity_factor, int num_days=0, bool export_time_series=false, bool rki_age_groups=true) |
| Sets the graph nodes for counties or districts. More... | |
| std::ostream & | set_ostream_format (std::ostream &out, size_t width, size_t precision, char fill=' ') |
| Adds manipulators for width, (fixed) precision and fill character to an ostream. More... | |
| template<typename FP , class Model , class Sim = mio::Simulation<FP, Model>> | |
| TimeSeries< FP > | simulate (FP t0, FP tmax, FP dt, Model const &model, std::unique_ptr< OdeIntegratorCore< FP >> &&integrator_core=nullptr) |
| Run a Simulation of a CompartmentalModel. More... | |
| template<typename FP , class Model , class Sim = FlowSimulation<FP, Model>> | |
| std::vector< TimeSeries< FP > > | simulate_flows (FP t0, FP tmax, FP dt, Model const &model, std::unique_ptr< OdeIntegratorCore< FP >> &&integrator_core=nullptr) |
| Run a FlowSimulation of a FlowModel. More... | |
| template<typename FP , class Model , class Sim = StochasticSimulation<FP, Model>> | |
| TimeSeries< FP > | simulate_stochastic (FP t0, FP tmax, FP dt, Model const &model, std::unique_ptr< SdeIntegratorCore< FP >> &&integrator_core=nullptr) |
| template<IsDynamicMatrix M> | |
| auto | slice (M &&m, Seq< Eigen::Index > rows, Seq< Eigen::Index > cols) |
| take a regular slice of a matrix. More... | |
| template<IsDynamicVector V> | |
| auto | slice (V &&v, Seq< Eigen::Index > elems) |
| take a regular slice of a row or column vector. More... | |
| template<typename FP , class LeftExpr , class RightExpr > | |
| auto | smoother_cosine (FP x, FP xleft, FP xright, const Eigen::MatrixBase< LeftExpr > &yleft_expr, const Eigen::MatrixBase< RightExpr > &yright_expr) |
| smoother_cosine as a matrix valued function. More... | |
| template<typename FP > | |
| FP | smoother_cosine (FP x, FP xleft, FP xright, FP yleft, FP yright) |
| Returns the smoothed evaluation of a discrete jump of function values yleft and yright on xleft and xright, respectively, by using a cosine function. More... | |
| std::vector< std::string > | split (const std::string &s, char delimiter) |
| Splits string into a Vector of strings according to delimiter. More... | |
| const details::StatusCodeCategory & | status_code_category () |
| singleton StatusCodeCategory instance. More... | |
| template<size_t Size> | |
| StringLiteral (const char(&string)[Size]) -> StringLiteral< Size - 1 > | |
| auto | success () |
| Create an object that is implicitly convertible to a succesful IOResult<void>. More... | |
| template<class T > | |
| auto | success (T &&t) |
| Create an object that is implicitly convertible to a succesful IOResult. More... | |
| template<typename FP > | |
| std::vector< std::vector< TimeSeries< FP > > > | sum_nodes (const std::vector< std::vector< TimeSeries< FP >>> &ensemble_result) |
| template<typename FP , class Sim > | |
| void | test_commuters (SimulationNode< FP, Sim > &node, Eigen::Ref< Eigen::VectorX< FP >> mobile_population, FP time) |
| Test persons when moving from their source node. More... | |
| RandomNumberGenerator & | thread_local_rng () |
| template<class... T> | |
| void | unused (T &&...) |
| Does nothing, can be used to mark variables as not used. More... | |
| template<class IOContext , class F , class... T> | |
| details::ApplyResultT< F, T... > | apply (IOContext &io, F f, const IOResult< T > &... rs) |
| Evaluate a function with zero or more unpacked IOResults as arguments. More... | |
| template<class IOContext , class F , class... T> | |
| details::ApplyResultT< F, T... > | apply (IOContext &io, F f, const std::tuple< IOResult< T >... > &results) |
| Evaluate a function with zero or more unpacked IOResults as arguments. More... | |
| template<typename FP , class Sim > | |
| GraphSimulation< FP, Graph< SimulationNode< FP, Sim >, MobilityEdge< FP > >, FP, FP, void(*)(FP, FP, mio::MobilityEdge< FP > &, mio::SimulationNode< FP, Sim > &, mio::SimulationNode< FP, Sim > &), void(*)(FP, FP, mio::SimulationNode< FP, Sim > &)> | make_mobility_sim (FP t0, FP dt, const Graph< SimulationNode< FP, Sim >, MobilityEdge< FP >> &graph) |
| create a mobility-based simulation. More... | |
| template<typename FP , class Sim > | |
| GraphSimulation< FP, Graph< SimulationNode< FP, Sim >, MobilityEdge< FP > >, FP, FP, void(*)(FP, FP, mio::MobilityEdge< FP > &, mio::SimulationNode< FP, Sim > &, mio::SimulationNode< FP, Sim > &), void(*)(FP, FP, mio::SimulationNode< FP, Sim > &)> | make_mobility_sim (FP t0, FP dt, Graph< SimulationNode< FP, Sim >, MobilityEdge< FP >> &&graph) |
| create a mobility-based simulation. More... | |
| template<typename FP , class Sim > | |
| auto | make_no_mobility_sim (FP t0, Graph< SimulationNode< FP, Sim >, MobilityEdge< FP >> &graph) |
| Create a graph simulation without mobility. More... | |
| template<typename FP , class Sim > | |
| auto | make_no_mobility_sim (FP t0, Graph< SimulationNode< FP, Sim >, MobilityEdge< FP >> &&graph) |
| Create a graph simulation without mobility. More... | |
| template<typename FP , class Sim > | |
| GraphSimulationStochastic< FP, Graph< SimulationNode< FP, Sim >, MobilityEdgeStochastic< FP > > > | make_mobility_sim (FP t0, FP dt, const Graph< SimulationNode< FP, Sim >, MobilityEdgeStochastic< FP >> &graph) |
| create a mobility-based simulation. More... | |
| template<typename FP , class Sim > | |
| GraphSimulationStochastic< FP, Graph< SimulationNode< FP, Sim >, MobilityEdgeStochastic< FP > > > | make_mobility_sim (FP t0, FP dt, Graph< SimulationNode< FP, Sim >, MobilityEdgeStochastic< FP >> &&graph) |
| create a mobility-based simulation. More... | |
| template<class SubIndex , class SuperIndex > | |
| decltype(auto) | reduce_index (const SuperIndex &index) |
| Create a SubIndex by copying values from SuperIndex. More... | |
| template<class Enum , class SuperIndex > | |
| requires std::is_enum_v< Enum > Index< Enum > | reduce_index (const SuperIndex &index) |
| Create a SubIndex by copying values from SuperIndex. More... | |
Comparison operators with scalar or AD type on right (UncertainValue <op> T) | |
| template<typename FP , typename T > | |
| bool | operator> (const UncertainValue< FP > &lhs, const T &rhs) |
| template<typename FP , typename T > | |
| bool | operator< (const UncertainValue< FP > &lhs, const T &rhs) |
| template<typename FP , typename T > | |
| bool | operator>= (const UncertainValue< FP > &lhs, const T &rhs) |
| template<typename FP , typename T > | |
| bool | operator<= (const UncertainValue< FP > &lhs, const T &rhs) |
| template<typename FP , typename T > | |
| bool | operator== (const UncertainValue< FP > &lhs, const T &rhs) |
| template<typename FP , typename T > | |
| bool | operator!= (const UncertainValue< FP > &lhs, const T &rhs) |
Comparison operators with scalar or AD type on left (T <op> UncertainValue) | |
| template<typename FP , typename T > | |
| bool | operator> (const T &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP , typename T > | |
| bool | operator< (const T &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP , typename T > | |
| bool | operator>= (const T &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP , typename T > | |
| bool | operator<= (const T &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP , typename T > | |
| bool | operator== (const T &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP , typename T > | |
| bool | operator!= (const T &lhs, const UncertainValue< FP > &rhs) |
Comparison operators between two UncertainValue objects | |
| template<typename FP > | |
| bool | operator> (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP > | |
| bool | operator< (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP > | |
| bool | operator>= (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP > | |
| bool | operator<= (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP > | |
| bool | operator== (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP > | |
| bool | operator!= (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
Arithmetic operators between two UncertainValue objects (returns FP) | |
| template<typename FP > | |
| FP | operator* (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP > | |
| FP | operator/ (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP > | |
| FP | operator+ (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP > | |
| FP | operator- (const UncertainValue< FP > &lhs, const UncertainValue< FP > &rhs) |
Arithmetic operators with scalar or AD type on right (UncertainValue <op> T) | |
| template<typename FP , typename T > | |
| FP | operator* (const UncertainValue< FP > &lhs, const T &rhs) |
| template<typename FP , typename T > | |
| FP | operator/ (const UncertainValue< FP > &lhs, const T &rhs) |
| template<typename FP , typename T > | |
| FP | operator+ (const UncertainValue< FP > &lhs, const T &rhs) |
| template<typename FP , typename T > | |
| FP | operator- (const UncertainValue< FP > &lhs, const T &rhs) |
Arithmetic operators with scalar or AD type on left (T <op> UncertainValue) | |
| template<typename FP , typename T > | |
| FP | operator* (const T &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP , typename T > | |
| FP | operator/ (const T &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP , typename T > | |
| FP | operator+ (const T &lhs, const UncertainValue< FP > &rhs) |
| template<typename FP , typename T > | |
| FP | operator- (const T &lhs, const UncertainValue< FP > &rhs) |
Compound assignment operators for FP and UncertainValue<FP> | |
| template<typename FP > | |
| FP & | operator+= (FP &lhs, const UncertainValue< FP > &rhs) |
| Print statement for UncertainValue<FP> (required for AD types) More... | |
| template<typename FP > | |
| FP & | operator-= (FP &lhs, const UncertainValue< FP > &rhs) |
| Print statement for UncertainValue<FP> (required for AD types) More... | |
| template<typename FP > | |
| FP & | operator*= (FP &lhs, const UncertainValue< FP > &rhs) |
| Print statement for UncertainValue<FP> (required for AD types) More... | |
| template<typename FP > | |
| FP & | operator/= (FP &lhs, const UncertainValue< FP > &rhs) |
| Print statement for UncertainValue<FP> (required for AD types) More... | |
| template<typename FP > | |
| std::ostream & | operator<< (std::ostream &os, const UncertainValue< FP > &uv) |
| Print statement for UncertainValue<FP> (required for AD types) More... | |
Variables | |
| const Container & | container |
| template<class... Types> | |
| constexpr bool | has_duplicates_v = has_duplicates<Types...>::value |
| Checks whether Type has any duplicates. More... | |
| template<class T > | |
| concept | HasApplyConstraints |
| Check that the given type has an apply_constraints member function. More... | |
| template<class T > | |
| concept | HasCheckConstraints |
| Check that the given type has a check_constraints member function. More... | |
| template<class T , class IOContext > | |
| concept | HasDeserialize |
| template<class T > | |
| concept | HasOstreamOperator = requires(std::ostream os, T t) { os << t; } |
| Concept to check if type T has an existing stream output operator "<<". More... | |
| template<class T , class IOContext > | |
| concept | HasSerialize = requires(IOContext& ctxt, const T& t) { t.serialize(ctxt); } |
| auto | i = obj.expect_list("Items", Tag<typename Container::value_type>{}) |
| template<class Type , class... Types> | |
| constexpr std::size_t | index_of_type_v = index_of_type<Type, Types...>::value |
| The index of Type in the list Types. More... | |
| template<class Type , class... Types> | |
| constexpr bool | is_type_in_list_v = is_type_in_list<Type, Types...>::value |
| Checks whether Type is in the list Types. More... | |
| template<class Model , typename FP > | |
| concept | IsCompartmentalModel |
| Concept to check if a type is a valid compartment model. More... | |
| template<class Simulation , typename FP > | |
| concept | IsCompartmentalModelSimulation |
| Concept to check if a type is a simulation for a compartmental model. More... | |
| template<class C > | |
| concept | IsContainer |
| Concept to check whether C is a STL compatible container. More... | |
| template<class T , class IOContext > | |
| concept | IsDefaultDeserializable |
| Detect whether T has a default_serialize member function, but no deserialize member. More... | |
| template<class T , class IOContext > | |
| concept | IsDefaultSerializable |
| Detect whether T has a default_serialize member function, but no serialize member. More... | |
| template<class M > | |
| concept | IsDynamicMatrix |
| check if Eigen::Matrix type M is a dynamic matrix type. More... | |
| template<class M > | |
| concept | IsDynamicVector |
| check if Eigen::Matrix type M is a dynamic vector type. More... | |
| template<class Model , typename FP > | |
| concept | IsFlowModel |
| Concept to check if a type is a valid FlowModel. More... | |
| template<class M > | |
| concept | IsMatrixExpression = std::is_base_of_v<Eigen::EigenBase<M>, M> |
| Concept to detect whether T is an Eigen matrix expression. More... | |
| template<typename... CategoryTags> | |
| concept | IsMultiIndex = requires(Index<CategoryTags...> i) { details::is_multi_index_impl(i); } |
| A MultiIndex is an Index with any number of categories. Does accept empty or single category indices. More... | |
| template<class Model , typename FP > | |
| concept | IsStochasticModel |
| Concept to check if a type is a valid stochastic model. More... | |
| Tag< Container > | |
| template<class T > | |
| constexpr bool | is_ad_type_v = is_ad_type<T>::value |
Detailed Description
A collection of classes to simplify handling of matrix shapes in meta programming.
Matrix shape types follow this model:
- subtype Matrix that is an alias of an Eigen matrix type
- at least one constructor that sets the shape from dimensions
- static member function
get_shape_ofthat takes a compatible matrix expression and returns it's shape - const member functions rows() and cols()
- trivially copyable, moveable, assignable, move assignable
- equality comparable
Typedef Documentation
◆ ConstParameterDistributionVisitor
| using mio::ConstParameterDistributionVisitor = typedef ConstVisitor<class ParameterDistributionNormal, class ParameterDistributionUniform, class ParameterDistributionLogNormal, class ParameterDistributionExponential, class ParameterDistributionConstant> |
◆ CVPlainMatrixT
| using mio::CVPlainMatrixT = typedef typename CVPlainMatrix<M>::Type |
◆ DefaultIntegratorCore
| using mio::DefaultIntegratorCore = typedef mio::ControlledStepperWrapper<FP, boost::numeric::odeint::runge_kutta_cash_karp54> |
The default integrator used by Simulation.
◆ DerivFunction
| using mio::DerivFunction = typedef std::function<void(Eigen::Ref<const Eigen::VectorX<FP> > y, FP t, Eigen::Ref<Eigen::VectorX<FP> > dydt)> |
Function template to be integrated.
- Template Parameters
-
FP A floating point type, e.g. double.
◆ FeedbackSimulationParameters
| using mio::FeedbackSimulationParameters = typedef ParameterSet<ICUOccupancyHistory<FP>, GammaShapeParameter<FP>, GammaScaleParameter<FP>, GammaCutOff, ContactReductionMax<FP>, ContactReductionMin<FP>, SoftPlusCurvatureParameter<FP>, NominalICUCapacity<FP>, BlendingFactorLocal<FP>, BlendingFactorRegional<FP> > |
◆ has_get_default_member_function
| using mio::has_get_default_member_function = typedef details::has_get_default_member_function<T, void, Args...> |
check whether a get_default function exists
- Template Parameters
-
The type to check for the existence of the member function
◆ HistoryWithMemoryWriter
| using mio::HistoryWithMemoryWriter = typedef History<DataWriterToMemory, Loggers...> |
◆ InterpolateResultT
| using mio::InterpolateResultT = typedef std::decay_t<decltype(interpolate_simulation_result(std::declval<T>()))> |
helper template, type returned by overload interpolate_simulation_result(T t)
◆ IOResult
| using mio::IOResult = typedef boost::outcome_v2::unchecked<T, IOStatus> |
Value-or-error type for operations that return a value but can fail.
Can also be used for functions that return void so that all IO functions have compatible signatures. e.g. IOResult<int> parse_int(const std::string& s); IOResult<void> mkdir(const std::string& path);
Create IOResult objects with:
success(t),failure(e): Create objects that store a T or IOStatus and are implicitly convertible to IOResult. This is the easiest way to return from a function that returns an IOResult.- constructors: IOResult can normally be constructed directly from T or IOStatus. If T is convertible to an error code (e.g. T = int), these constructors are disabled. There are constructors IOResult(Tag<T>{}, t) and IOResult(Tag<IOStatus>{}, e) that always work.
Inspect the result with:
operator bool(): true if result represents success.value(): returns a reference to the value.error(): returns a reference to the error.value()/error()assert (terminate in debug mode) if the result is not succesful/not an error.
When nesting functions that return IOResult, it is also possible to unpack the value and forward errors using the macro BOOST_OUTCOME_TRY. The statement BOOST_OUTCOME_TRY(x, try_get_x()); is equivalent to the statements
This way, code the branches that are added for error handling are not visible in your code, the logic looks completely linear, e.g.:
The variable name can be omitted for operations that return IOResult<void>.
- Template Parameters
-
the type produced by an opertion that can fail.
◆ is_64bit_integral
| using mio::is_64bit_integral = typedef std::integral_constant<bool, (std::is_integral_v<T> && sizeof(T) == 8)> |
Bool constant to check whether T is an integral type of 64 bits. Used for Json library.
◆ is_no_default_init_tag
| using mio::is_no_default_init_tag = typedef std::is_same<NoDefaultInit, T> |
◆ is_small_integral
| using mio::is_small_integral = typedef std::integral_constant<bool, (std::is_integral_v<T> && sizeof(T) <= 4)> |
Bool constant to check whether T is an integral type of 32 bits or less. Used for Json library.
◆ MobilityCoefficientGroup
| using mio::MobilityCoefficientGroup = typedef DampingMatrixExpressionGroup<FP, MobilityCoefficients<FP> > |
sum of time dependent mobility coefficients.
differentiate between sources of mobility.
◆ MobilityCoefficients
| using mio::MobilityCoefficients = typedef DampingMatrixExpression<FP, VectorDampings<FP> > |
time dependent mobility coefficients.
status and age dependent mobility coefficients.
◆ not_copyable_if
| using mio::not_copyable_if = typedef std::conditional<Cond, details::NoCopy, details::Empty> |
Defines a type that is not copy constructible or assignable if the specified condition is true.
Otherwise, defines a type that is copyable. In both cases, the type will be trivially moveable and constructible. To be used as a base type to make a class conditionally copyable. Can be used to e.g. ensure that std::is_copy_constructible and std::is_copy_assignable is true only if the type can actually be copied (Note: this is not true for some STL containers, e.g., std::vector).
◆ not_copyable_if_t
| using mio::not_copyable_if_t = typedef typename not_copyable_if<Cond>::type |
equivalent to not_copyable_if<Cond>::type.
- See also
- not_copyable_if
◆ OdeIntegrator
| using mio::OdeIntegrator = typedef SystemIntegrator<FP, DerivFunction<FP> > |
Solver for a system of initial value problems (IVPs) consisting of ordinary differential equations (ODEs).
The IVPs are of the form y'(t) = f(y(t), t), y(0) = y0.
◆ OdeIntegratorCore
| using mio::OdeIntegratorCore = typedef IntegratorCore<FP, DerivFunction<FP> > |
Interface for defining solvers for ODE problems. Also.
- See also
- IntegratorCore and
- CompartmentalModel.
◆ ParameterDistributionVisitor
| using mio::ParameterDistributionVisitor = typedef Visitor<class ParameterDistributionNormal, class ParameterDistributionUniform, class ParameterDistributionLogNormal, class ParameterDistributionExponential, class ParameterDistributionConstant> |
This is a visitor class to visit all Parameter Distribution objects.
More information to the visitor pattern is here: https://en.wikipedia.org/wiki/Visitor_pattern
◆ ParameterTag
| using mio::ParameterTag = typedef details::ParameterTag<I, ParamSet> |
get the the tag of the I-th parameter in a set
◆ ParameterTagT
| using mio::ParameterTagT = typedef typename ParameterTag<I, ParamSet>::Type |
◆ SdeIntegrator
| using mio::SdeIntegrator = typedef SystemIntegrator<FP, DerivFunction<FP>, DerivFunction<FP> > |
Solver for a system of initial value problems (IVPs) consisting of stochastic differential equations (SDEs).
The IVPs are of the form dY'(t) = f(Y(t), t)dt + g(Y(t), t)dW(t), y(0) = y0. Each summand corresponds to one DerivFunction.
◆ SdeIntegratorCore
| using mio::SdeIntegratorCore = typedef IntegratorCore<FP, DerivFunction<FP>, DerivFunction<FP> > |
Interface for defining solvers for SDE problems. Also.
- See also
- IntegratorCore and
- StochasticModel.
◆ SquareDamping
| using mio::SquareDamping = typedef Damping<FP, SquareMatrixShape<FP> > |
aliases for common damping specializations.
◆ SquareDampings
| using mio::SquareDampings = typedef Dampings<FP, SquareDamping<FP> > |
◆ Tag
| using mio::Tag = typedef boost::outcome_v2::in_place_type_t<T> |
Type that is used for overload resolution.
Use as dummy arguments to resolve overloads that would otherwise only differ by return type and don't have any other arguments that allow resolution. e.g.
◆ type_at_index_t
| using mio::type_at_index_t = typedef typename type_at_index<Index, Types...>::type |
The type at the Index-th position in the list Types.
Equivalent to type_at<Index, Types...>::type.
- See also
- type_at_index.
◆ VectorDamping
| using mio::VectorDamping = typedef Damping<FP, ColumnVectorShape<FP> > |
◆ VectorDampings
| using mio::VectorDampings = typedef Dampings<FP, VectorDamping<FP> > |
◆ VectorRange
| using mio::VectorRange = typedef std::conditional_t<std::is_const_v<T>, typename mio::Range<typename std::vector<std::remove_const_t<T> >::const_iterator>, typename mio::Range<typename std::vector<std::remove_const_t<T> >::iterator> > |
Defines generic Range type for IterPair of a vector.
When elements should be const, template argument accepts const type. As vector is not defined for const values, the const specifier is removed and the const_iterator is used. std::conditional tries to compile both cases, thus we also need std::remove_const for the case where T is not const.
◆ VisitableParameterDistribution
| using mio::VisitableParameterDistribution = typedef Visitable<Derived, class ParameterDistribution, ParameterDistributionVisitor, ConstParameterDistributionVisitor> |
Enumeration Type Documentation
◆ IOFlags
| enum mio::IOFlags |
flags to determine the behavior of the serialization process.
Objects must be deseralized with the same set of flags as they were serialized.
| Enumerator | |
|---|---|
| IOF_None | default behavior. |
| IOF_OmitDistributions | Don't serialize distributions for types that contain both a specific value and a distribution from which new values can be sampled, e.g. |
| IOF_OmitValues | Don't serialize the current value for types that contain both a specific value and a distribution from which new values can be sampled, e.g., UncertainValue. |
| IOF_IncludeTypeInfo | Include type info in the serialization. Can Increase file size a lot, mostly for debugging. |
◆ LogLevel
|
strong |
◆ StatusCode
|
strong |
code to indicate the result of an operation.
convertible to std::error_code. see https://www.boost.org/doc/libs/1_75_0/libs/outcome/doc/html/motivation/plug_error_code.html
| Enumerator | |
|---|---|
| OK | |
| UnknownError | |
| OutOfRange | |
| InvalidValue | |
| InvalidFileFormat | |
| KeyNotFound | |
| InvalidType | |
| FileNotFound | |
◆ TimeSeriesFunctorType
|
strong |
Type of a TimeSeriesFunctor.
The available types are:
- LinearInterpolation:
- Requires at least one time point with exactly one value each. Time must be strictly monotic increasing.
- Linearly interpolates between data points. Stays constant outside of provided data with first/last value.
| Enumerator | |
|---|---|
| LinearInterpolation | |
Function Documentation
◆ abs_max()
| FP mio::abs_max | ( | FP | v1, |
| FP | v2 | ||
| ) |
maximum absolute value of two numbers.
- Parameters
-
v1 first number v2 second number
- Returns
- maximum absolute value between v1 and v2
◆ add_list()
| obj mio::add_list | ( | "Items" | , |
| container. | begin(), | ||
| container. | end() | ||
| ) |
◆ advance_model() [1/2]
| void mio::advance_model | ( | abm::TimePoint | t, |
| abm::TimeSpan | dt, | ||
| ABMSimulationNode< History... > & | node | ||
| ) |
Node functor for abm graph simulation.
- See also
- ABMSimulationNode::advance
- Parameters
-
[in] t Time point the functor is applied. [in] dt Time interval the node is advanced. [in] node ABMSimulationNode to which the functor is applied.
◆ advance_model() [2/2]
| void mio::advance_model | ( | FP | t, |
| FP | dt, | ||
| SimulationNode< FP, Sim > & | node | ||
| ) |
edge functor for mobility-based simulation.
- See also
- SimulationNode::advance
◆ apply() [1/3]
| return mio::apply | ( | io | , |
| [] (auto &&i_) { return Container(i_.begin(), i_.end());} | , | ||
| i | |||
| ) |
◆ apply() [2/3]
| details::ApplyResultT<F, T...> mio::apply | ( | IOContext & | io, |
| F | f, | ||
| const IOResult< T > &... | rs | ||
| ) |
Evaluate a function with zero or more unpacked IOResults as arguments.
Returns an IOResult that contains the result of f(rs.value()...) if all IOResults rs contain a value. If any IOResult contains an error, that error is returned instead. The function f may return an object of any type U. It can also return IOResult (e.g. to validate the values contained in the arguments). In either case, apply returns IOResult and never any nested IOResult<IOResult>. If apply returns an error, it is also stored in the given IO context so that the context is informed of e.g. validation errors that cannot be checked simply from the types and the format of the file.
- Template Parameters
-
IOContext a type with a set_error(const IOStatus&) member function. F a type that has a function call operator with signature either U F(T&&...)orIOResult<U> F(T&&...)for anyU.T zero ore more types of values contained in the IOResult arguments.
- Parameters
-
io an IOContext that is notified of errors. f the function that is called with the values contained in rsas arguments.rs zero or more IOResults from previous operations.
- Returns
- the result of f(rs.value()...) if successful, the first error encountered otherwise.
◆ apply() [3/3]
| details::ApplyResultT<F, T...> mio::apply | ( | IOContext & | io, |
| F | f, | ||
| const std::tuple< IOResult< T >... > & | results | ||
| ) |
Evaluate a function with zero or more unpacked IOResults as arguments.
Returns an IOResult that contains the result of f(rs.value()...) if all IOResults rs contain a value. If any IOResult contains an error, that error is returned instead. The function f may return an object of any type U. It can also return IOResult (e.g. to validate the values contained in the arguments). In either case, apply returns IOResult and never any nested IOResult<IOResult>. If apply returns an error, it is also stored in the given IO context so that the context is informed of e.g. validation errors that cannot be checked simply from the types and the format of the file.
- Template Parameters
-
IOContext a type with a set_error(const IOStatus&) member function. F a type that has a function call operator with signature either U F(T&&...)orIOResult<U> F(T&&...)for anyU.T zero ore more types of values contained in the IOResult arguments.
- Parameters
-
io an IOContext that is notified of errors. f the function that is called with the values contained in rsas arguments.rs zero or more IOResults from previous operations.
- Returns
- the result of f(rs.value()...) if successful, the first error encountered otherwise.
◆ apply_dampings()
| void mio::apply_dampings | ( | DampingExpression & | damping_expression, |
| const DampingSamplings & | dampings, | ||
| F | make_matrix | ||
| ) |
add sampled dampings to a damping expression.
does not draw new random value, just adds dampings.
- Parameters
-
damping_expression e.g. contact matrix group. dampings sampled dampings. make_mask functor that creates a matrix from damping value weighted by group.
◆ apply_mobility() [1/3]
| void mio::apply_mobility | ( | abm::TimePoint | t, |
| abm::TimeSpan | , | ||
| ABMMobilityEdge< History... > & | edge, | ||
| ABMSimulationNode< History... > & | node_from, | ||
| ABMSimulationNode< History... > & | node_to | ||
| ) |
Edge functor for abm graph simulation.
- See also
- ABMMobilityEdge::apply_mobility The attribute dt is required by the GraphSimulation class and therefore an input argument of the function. However it is not used in ABMMobilityEdge::apply_mobility.
- Parameters
-
[in] t Time point the functor is applied. [in] edge ABMMobilityEdge for which the functor is applied. [in] node_from Edge start node. [in] node_to Edge end node.
◆ apply_mobility() [2/3]
| void mio::apply_mobility | ( | FP | t, |
| FP | dt, | ||
| MobilityEdge< FP > & | mobilityEdge, | ||
| SimulationNode< FP, Sim > & | node_from, | ||
| SimulationNode< FP, Sim > & | node_to | ||
| ) |
edge functor for mobility-based simulation.
- See also
- MobilityEdge::apply_mobility
◆ apply_mobility() [3/3]
| void mio::apply_mobility | ( | StochasticEdge & | mobilityEdge, |
| size_t | event, | ||
| SimulationNode< FP, Sim > & | node_from, | ||
| SimulationNode< FP, Sim > & | node_to | ||
| ) |
edge functor for mobility-based simulation.
◆ base_dir()
|
static |
Returns the absolute path to the project directory.
◆ begin() [1/3]
| RowMajorIterator<M, true> mio::begin | ( | const M & | m | ) |
create a const iterator to first element of the matrix m.
◆ begin() [2/3]
| MultiIndexIterator<Index<Categories...> > mio::begin | ( | Index< Categories... > | dimensions | ) |
STL iterator for a MultiIndex.
The range spans over [0, d) for each category in the MultiIndex, where d is that category's value in dimensions.
- Parameters
-
[in] dimensions A MultiIndex that contains the dimension for each category.
- Template Parameters
-
Categories All categories of the given MultiIndex.
- Returns
- Returns the first index for the given dimensions, i.e. 0.
◆ begin() [3/3]
| requires details::IsElementReference<M> RowMajorIterator<M, false> mio::begin | ( | M & | m | ) |
create a non-const iterator to first element of the matrix m.
only enabled if the matrix is evaluated in memory, i.e. elements can be modified.
◆ calculate_mobility_returns()
| void mio::calculate_mobility_returns | ( | Eigen::Ref< typename TimeSeries< FP >::Vector > | mobile_population, |
| const Sim & | sim, | ||
| Eigen::Ref< const typename TimeSeries< FP >::Vector > | total, | ||
| FP | t, | ||
| FP | dt | ||
| ) |
adjust number of people that changed node when they return according to the model.
E.g. during the time in the other node, some people who left as susceptible will return exposed. Implemented for general compartmentmodel simulations, overload for your custom model if necessary so that it can be found with argument-dependent lookup, i.e. in the same namespace as the model.
- Parameters
-
[in,out] mobile_population number of people that changed node as input, number of people that return as output params parameters of model in the node that the people changed to. total total population in the node that the people changed to. t time of mobility dt time between mobility and return
◆ calculate_partial_sum_of_months()
|
inline |
Computes the cumulative number of days at the end of each month for a given year.
- Parameters
-
date Date object representing the year we use to compute the cumulative days.
- Returns
- array with partial sum for each month
◆ cbegin()
| RowMajorIterator<M, true> mio::cbegin | ( | const M & | m | ) |
create a const iterator to first element of the matrix m.
◆ cend()
| RowMajorIterator<M, true> mio::cend | ( | const M & | m | ) |
create a non-const end iterator for the matrix m.
◆ concatenate_indices()
| decltype(auto) mio::concatenate_indices | ( | IndexArgs &&... | args | ) |
Combine several Indexs into one MultiIndex.
- Parameters
-
args Either enum or MultiIndex values.
- Returns
- A MultiIndex with all categories and values of the given Indices concatonated.
◆ contains()
| bool mio::contains | ( | Iter | b, |
| Iter | e, | ||
| Pred | p | ||
| ) |
checks if there is an element in this range that matches a predicate
◆ count_lines()
| IOResult< int > mio::count_lines | ( | const std::string & | filename | ) |
Counts lines of txt file.
- Parameters
-
filename name of file which is counted
◆ create_directory() [1/2]
| IOResult< bool > mio::create_directory | ( | std::string const & | rel_path | ) |
Creates a directory in the file system.
- Parameters
-
rel_path path of directory relative to current working directory.
- Returns
- true if the directory was created, false if it already exists, or any errors that occured.
◆ create_directory() [2/2]
| IOResult< bool > mio::create_directory | ( | std::string const & | rel_path, |
| std::string & | abs_path | ||
| ) |
Creates a directory in the file system.
- Parameters
-
rel_path path of directory relative to current working directory. abs_path Will contain the absolute path of the directory.
- Returns
- true if the directory was created, false if it already exists, or any errors that occured.
◆ DECL_TYPESAFE() [1/2]
| mio::DECL_TYPESAFE | ( | int | , |
| DampingLevel | |||
| ) |
integer damping level.
◆ DECL_TYPESAFE() [2/2]
| mio::DECL_TYPESAFE | ( | int | , |
| DampingType | |||
| ) |
integer damping type.
◆ deserialize()
| IOResult< T > mio::deserialize | ( | IOContext & | io, |
| Tag< T > | tag | ||
| ) |
Restores an object from the data stored in an IO context.
There must be provided for the type T either a free function deserialize_internal(io, tag) that can be found using argument dependent lookup (ADL) or a static member function T::deserialize(io). The deserialize_internal function or deserialize member function retrieve the data needed to restore the object from the IO context. The context provides the data if it can and keeps track of errors. deserialize_internal overloads are already provided for many common types, e.g. STL containers or Eigen Matrices. serialize and deserialize are the main entry points into this IO framework, but there may be more convenient functions provided for specific IO contexts. These functions are not expected to use ADL, so should be called namespace qualified.
- Template Parameters
-
IOContext a type that models the IOContext concept. T any deserializable type, i.e., that has a deserializemember function ordeserialize_internaloverload
- Parameters
-
io IO context that contains the data for an object of type T tag specifies the type to be restored from the data, for overload resolution only.
- Returns
- the restored T if succesful, an error code otherwise.
◆ deserialize_binary()
| IOResult<T> mio::deserialize_binary | ( | ByteStream & | stream, |
| Tag< T > | , | ||
| int | flags = 0 |
||
| ) |
Deserialize an object from binary format.
- Parameters
-
stream ByteStream that contains the bytes that represent the object. tag Tag that carries the type of the object to be deserialized.
- Returns
- The deserialized object if succesful, an error otherwise.
- Template Parameters
-
T the type of the object to be serialized.
◆ deserialize_internal() [1/7]
| IOResult<AbstractParameterDistribution> mio::deserialize_internal | ( | IOContext & | io, |
| Tag< AbstractParameterDistribution > | |||
| ) |
deserialize a AbstractParameterDistribution.
- See also
- mio::deserialize
◆ deserialize_internal() [2/7]
| requires std::is_enum_v<E> IOResult<E> mio::deserialize_internal | ( | IOContext & | io, |
| Tag< E > | |||
| ) |
deserialize an enum value from its underlying type.
It is impossible to validate the range of the enum type, validate after if necessary.
- Template Parameters
-
IOContext a type that models the IOContext concept. E an enum type to be deserialized.
- Parameters
-
io an IO context tag defines the type of the enum to be deserialized
- Returns
- an enum value if succesful, an error otherwise.
◆ deserialize_internal() [3/7]
| IOResult<M> mio::deserialize_internal | ( | IOContext & | io, |
| Tag< M > | |||
| ) |
deserialize an Eigen matrix.
It is possible to serialize an unevaluated expression, e.g. Eigen::MatrixXd::Constant(r, c, v). But it is (at least currently) not possible to deserialize it. Only matrices that own their memory can be deserialized.
- Template Parameters
-
IOContext a type that models the IOContext concept. M the type of Eigen matrix expression to be deserialized.
- Parameters
-
io an IO context. tag defines the type of the matrix to be serialized.
◆ deserialize_internal() [4/7]
| IOResult<std::bitset<N> > mio::deserialize_internal | ( | IOContext & | io, |
| Tag< std::bitset< N >> | tag | ||
| ) |
Deserialize an std::bitset.
- Template Parameters
-
IOContext A type that models the IOContext concept. N The size of the bitset.
- Parameters
-
io An IO context. tag Defines the type of the object that is to be deserialized.
- Returns
- The restored object if successful, an error otherwise.
◆ deserialize_internal() [5/7]
| IOResult<std::shared_ptr<ParameterDistribution> > mio::deserialize_internal | ( | IOContext & | io, |
| Tag< std::shared_ptr< ParameterDistribution >> | |||
| ) |
deserialize a parameter distribution as a shared_ptr.
- See also
- mio::deserialize
◆ deserialize_internal() [6/7]
| IOResult< T > mio::deserialize_internal | ( | IOContext & | io, |
| Tag< T > | tag | ||
| ) |
Deserialization implementation for the default serialization feature.
deserialize an object that has a deserialize(io) static member function.
Disables itself (SFINAE) if there is no default_serialize member or if a deserialize member is present. Generates the deserialize method depending on the NamedRefs given by default_serialize.
- Template Parameters
-
IOContext A type that models the IOContext concept. DefaultSerializable A type that can be default serialized.
- Parameters
-
io An IO context. tag Defines the type of the object that is to be deserialized (i.e. DefaultSerializble).
- Returns
- The restored object if successful, an error otherwise.
- Template Parameters
-
IOContext a type that models the IOContext concept. T the type of the object to be deserialized. Must have a serialize member function.
- Parameters
-
io an io context. tag defines the type of the object for overload resolution.
- Returns
- the restored object if succesful, an error otherwise.
◆ deserialize_internal() [7/7]
| requires std::same_as<Tup<T...>, std::pair<T...> > std::same_as<Tup<T...>, std::tuple<T...> > IOResult<Tup<T...> > mio::deserialize_internal | ( | IOContext & | io, |
| Tag< Tup< T... >> | tag | ||
| ) |
deserialize a tuple-like object, e.g.
std::tuple or std::pair.
- Template Parameters
-
IOContext a type that models the IOContext concept. Tup the tuple-like type to be deserialized, i.e. anything that supports tuple_size and tuple_element.
- Parameters
-
io an IO context. tag define the type of the object to be deserialized.
- Returns
- a restored tuple
◆ dynamic_unique_ptr_cast()
| std::unique_ptr<U> mio::dynamic_unique_ptr_cast | ( | std::unique_ptr< T > && | base_ptr | ) |
converts a unique_ptr<T> to unique_ptr.
behavior is similar to normal dynamic_cast except if the conversion is successful, the original unique_ptr<T> is now in a moved-from state and ownership of the object has been transferred to the returned unique_ptr.
- Parameters
-
base_ptr ptr to object to convert
- Returns
- converted unique_ptr if object can be cast to U, default unique_ptr otherwise
◆ end() [1/3]
| RowMajorIterator<M, true> mio::end | ( | const M & | m | ) |
create a const end iterator for the matrix m.
◆ end() [2/3]
| MultiIndexIterator<Index<Categories...> > mio::end | ( | Index< Categories... > | dimensions | ) |
STL iterator for a MultiIndex.
The range spans over [0, d) for each category in the MultiIndex, where d is that category's value in dimensions.
- Parameters
-
[in] dimensions A MultiIndex that contains the dimension for each category.
- Template Parameters
-
Categories All categories of the given MultiIndex.
- Returns
- Returns the first index outside of the given dimensions.
◆ end() [3/3]
| requires details::IsElementReference<M> RowMajorIterator<M, false> mio::end | ( | M & | m | ) |
create a non-const end iterator for the matrix m.
◆ ensemble_mean()
| std::vector< TimeSeries< FP > > mio::ensemble_mean | ( | const std::vector< std::vector< TimeSeries< FP >>> & | ensemble_results | ) |
computes mean of each compartment, node, and time point over all runs input must be uniform as returned by interpolated_ensemble_result: same number of nodes, same time points and elements.
- See also
- interpolated_ensemble_result
- Parameters
-
ensemble_results uniform results of multiple simulation runs
- Returns
- mean of the results over all runs
◆ ensemble_percentile()
| std::vector< TimeSeries< FP > > mio::ensemble_percentile | ( | const std::vector< std::vector< TimeSeries< FP >>> & | ensemble_result, |
| FP | p | ||
| ) |
computes the p percentile of the result for each compartment, node, and time point.
Produces for each compartment the value that that is bigger than approximately a p-th share of the values of this compartment over all runs. input must be uniform as returned by interpolated_ensemble_result: same number of nodes, same time points and elements.
- See also
- interpolated_ensemble_result
- Parameters
-
ensemble_result uniform results of multiple simulation runs p percentile value in open interval (0, 1)
- Returns
- p percentile of the results over all runs
◆ enum_members()
|
constexpr |
Get an std::array that contains all members of an enum class.
The enum class must be a valid index, i.e. members must be sequential starting at 0 and there must be a member Count at the end, that will not be included in the array. Example:
- Template Parameters
-
T An enum class that is a valid index.
- Returns
- Array of all members of the enum class not including T::Count.
◆ evaluate_intermediate()
|
inline |
Evaluate an intermediate expression to its underlying type, if necessary.
- Parameters
-
x An intermediate expression, resulting e.g. from auto x = y + z.
- Template Parameters
-
Type Underlying type of the expression, e.g. an AD type. Usually this is set to FP.Intermediate Type of the expression result. Do not specify this template, let the compiler deduce it.
- Returns
- Either casts the intermediate expression to Type, or forwards it.
The main purpose of this function is reconcile the handling of intermediate types from Eigen and AD. Eigen wants to return intermediates for optimization, while AD values must be evaluated (due to using references).
◆ extend_index()
| SuperIndex mio::extend_index | ( | const SubIndex & | index, |
| size_t | fill_value = 0 |
||
| ) |
Create a SuperIndex by copying values from SubIndex, filling new categories with fill_value.
If a type T is contained multiple times in SubIndex, only the first occurance of T is used. For example, extend_index<Index<T, T, T>>(Index<T, T>{1,2}) returns {1,1,1}.
- Parameters
-
[in] index An instance of SubIndex [in] fill_value The value to use for categories not in SubIndex.
- Template Parameters
-
SuperIndex Any Index. SubIndex An Index that contains a subset of the categories from SuperIndex.
- Returns
- A (super)index with the given categories and values from index.
◆ failure() [1/2]
|
inline |
Create an object that is implicitly convertible to an error IOResult<T>.
Use return failure(s) to conveniently return an error from a function.
- Parameters
-
s the status that contains the error.
◆ failure() [2/2]
|
inline |
Create an object that is implicitly convertible to an error IOResult<T>.
Use return failure(c, msg) to conveniently return an error from a function.
- Parameters
-
c an error code. msg a string that contains more information about the error.
◆ file_exists()
| bool mio::file_exists | ( | std::string const & | rel_path, |
| std::string & | abs_path | ||
| ) |
Check if a file exists.
Also computes the absolute path of the file.
- Parameters
-
[in] rel_path relative path to the file. [out] abs_path absolute path, computed by the function.
- Returns
- true if the file exists.
◆ find_value_reverse()
| decltype(std::declval<TS>().rend()) mio::find_value_reverse | ( | TS && | ts, |
| FP | t_search, | ||
| FP | abs_tol = 0, |
||
| FP | rel_tol = 0 |
||
| ) |
find the value in the time series at time t_search starting from the end.
- Parameters
-
ts TimeSeries to seach t_search a time point abs_tol absolute floating point tolerance for equality of time values rel_tol relative floating point tolerance for equality of time values
- Returns
- TimeSeries::reverse_iterator that points to ts[t_search] or ts.rend()
◆ flatten_index()
| size_t mio::flatten_index | ( | MultiIndex const & | indices, |
| MultiIndex const & | dimensions | ||
| ) |
flatten_index takes a set of indices into a mutlidemsional array and calculates the flat index
Given indices (i,j,k,...) of a tensor with dimensions (n,m,l,...), flatten_index calculates the index of the corresponding element if the elements are sorted sequentially in a row major fashion (that is right indices are incremented before left indices)
- Parameters
-
indices a vector of indices of a hypothetical tensor dimensions a vector of the dimension sizes of each dimension
- Returns
- the corresponding flat index
◆ floating_point_equal()
| bool mio::floating_point_equal | ( | FP | v1, |
| FP | v2, | ||
| FP | abs_tol = 0, |
||
| FP | rel_tol = std::numeric_limits<FP>::min() |
||
| ) |
compare two floating point values for equality with tolerances.
Use absolute tolerance for comparisons with zero or if you know the magnitude of the values. Otherwise use relative tolerance. If unsure, use both.
- Parameters
-
v1 first floating point value v2 second floating point value abs_tol maximum allowed absolute difference, default 0. rel_tol maximum allowed relative difference, default numeric_limits::min.
- Returns
- true if v1 is within the specified relative OR absolute tolerance of v2
◆ floating_point_greater()
| bool mio::floating_point_greater | ( | FP | v1, |
| FP | v2, | ||
| FP | abs_tol = 0, |
||
| FP | rel_tol = std::numeric_limits<FP>::min() |
||
| ) |
compare two floating point values with tolerances.
v1 > v2 if a) v1 not == v2 within tolerances AND b) v1 not < v2. Use absolute tolerance for comparisons with zero or if you know the magnitude of the values. Use relative tolerance (or both) otherwise.
- Parameters
-
v1 first floating point value v2 second floating point value abs_tol maximum allowed absolute difference, default 0. rel_tol maximum allowed relative difference, default numeric_limits::min.
- Returns
- true if v1 is greater than v2 and not within absolute or relative tolerance of v2.
◆ floating_point_greater_equal()
| bool mio::floating_point_greater_equal | ( | FP | v1, |
| FP | v2, | ||
| FP | abs_tol = 0, |
||
| FP | rel_tol = std::numeric_limits<FP>::min() |
||
| ) |
compare two floating point values with tolerances.
v1 >= v2 if a) v1 > v2 OR b) v1 == v2 within tolerances. Use absolute tolerance for comparisons with zero or if you know the magnitude of the values. Use relative tolerance (or both) otherwise.
- Parameters
-
v1 first floating point value v2 second floating point value abs_tol maximum allowed absolute difference, default 0. rel_tol maximum allowed relative difference, default numeric_limits::min.
- Returns
- true if v1 is greater than v2 or within absolute or relative tolerance of v2.
◆ floating_point_less()
| bool mio::floating_point_less | ( | FP | v1, |
| FP | v2, | ||
| FP | abs_tol = 0, |
||
| FP | rel_tol = std::numeric_limits<FP>::min() |
||
| ) |
compare two floating point values with tolerances.
v1 < v2 if a) v1 not == v2 within tolerances and b) v1 not > v2. Use absolute tolerance for comparisons with zero or if you know the magnitude of the values. Use relative tolerance (or both) otherwise.
- Parameters
-
v1 first floating point value v2 second floating point value abs_tol maximum allowed absolute difference for equality, default 0. rel_tol maximum allowed relative difference for equality, default numeric_limits::min.
- Returns
- true if v1 is less than v2 and not within relative or absolute tolerance of v2.
◆ floating_point_less_equal()
| bool mio::floating_point_less_equal | ( | FP | v1, |
| FP | v2, | ||
| FP | abs_tol = 0, |
||
| FP | rel_tol = std::numeric_limits<FP>::min() |
||
| ) |
compare two floating point values with tolerances.
v1 <= v2 if a) v1 < v2 OR b) v1 == v2 within tolerances. Use absolute tolerance for comparisons with zero or if you know the magnitude of the values. Use relative tolerance (or both) otherwise.
- Parameters
-
v1 first floating point value v2 second floating point value abs_tol maximum allowed absolute difference, default 0. rel_tol maximum allowed relative difference, default numeric_limits::min.
- Returns
- true if v1 is less than v2 or within relative or absolute tolerances of v2.
◆ foreach() [1/2]
| void mio::foreach | ( | const ParameterSet< Tags... > & | p, |
| F | f | ||
| ) |
call f(p, t) for all parameters in a ParameterSet with p the value of the parameter t a default constructed parameter tag
- Template Parameters
-
F The function type of f Tags the parameters
- Parameters
-
p the ParameterSet f The function to be called
◆ foreach() [2/2]
| void mio::foreach | ( | ParameterSet< Tags... > & | p, |
| F | f | ||
| ) |
◆ foreach_tag()
| void mio::foreach_tag | ( | F | f | ) |
call f(t) for all parameters in a ParameterSet with t a default constructed parameter tag
- Template Parameters
-
Params a ParameterSet F The function type of f
- Parameters
-
f The function to be called
◆ format_as() [1/2]
|
inline |
Format date objects using the ISO notation for logging with spdlog.
- Parameters
-
d date object.
◆ format_as() [2/2]
| const FP& mio::format_as | ( | const UncertainValue< FP > & | uv | ) |
Format UncertainValues using their value for logging with spdlog.
◆ get() [1/4]
|
constexprnoexcept |
Retrieves the Index (by reference) at the Ith position of a MultiIndex.
◆ get() [2/4]
|
constexprnoexcept |
Retrieves the Index (by reference) by its Tag in a MultiIndex. Requires unique tags.
◆ get() [3/4]
|
constexprnoexcept |
Retrieves the Index (by const reference) at the Ith position of a MultiIndex.
◆ get() [4/4]
|
constexprnoexcept |
Retrieves the Index (by const reference) by its Tag in a MultiIndex. Requires unique tags.
◆ get_active_damping()
| Eigen::Ref<const typename DampingExpr::Matrix> mio::get_active_damping | ( | const DampingExpr & | damping_expr, |
| DampingLevel | lvl, | ||
| DampingType | type, | ||
| SimulationTime< FP > | t | ||
| ) |
Get the value of the damping that matches the given type and level and that is active at the specified time.
If no damping is found, returns a zero matrix of the correct shape. Utility for implementation of dynamic NPIs.
- Parameters
-
damping_expr some matrix expression that contains dampings, e.g. a ContactMatrix. lvl damping level to match type damping type to match time time where the damping is active
- Returns
- matrix of damping coefficients if active damping is found. zero matrix otherwise.
◆ get_current_dir_name()
| std::string mio::get_current_dir_name | ( | ) |
Returns the current working directory name.
◆ get_damping_indices()
| std::vector<size_t> mio::get_damping_indices | ( | const DampingExpr & | damping_expr, |
| DampingLevel | lvl, | ||
| DampingType | type, | ||
| SimulationTime< FP > | begin, | ||
| SimulationTime< FP > | end | ||
| ) |
Get a list of indices of specified dampings.
Returns the indices of dampings that match the given type and level and that become active in the specified time span (excluding the particular interval boundaries, begin and end). Utility for implementation of dynamic NPIs.
- Parameters
-
damping_expr some matrix expression that contains dampings, e.g. a ContactMatrix. lvl damping level to match type damping type to match begin beginning of the time span that contains the dampings end end of the time span that contains the dampings.
- Returns
- list of indices in range damping_expr.get_dampings()
◆ get_day_in_year()
|
inline |
Computes the day in year based on a given date.
- Parameters
-
date date
- Returns
- day in year, starting January, 1st, with 1.
◆ get_infections_relative()
| FP mio::get_infections_relative | ( | const SimulationNode< FP, Sim > & | node, |
| FP | t, | ||
| const Eigen::Ref< const Eigen::VectorX< FP >> & | y | ||
| ) |
get the percantage of infected people of the total population in the node If dynamic NPIs are enabled, there needs to be an overload of get_infections_relative(model, y) for the Model type that can be found with argument-dependent lookup.
Ideally define get_infections_relative in the same namespace as the Model type.
- Parameters
-
node a node of a mobility graph. y the current value of the simulation. t the current simulation time
◆ get_mobility_factors()
| auto mio::get_mobility_factors | ( | const SimulationNode< FP, Sim > & | node, |
| FP | t, | ||
| const Eigen::Ref< const Eigen::VectorX< FP >> & | y | ||
| ) |
Get an additional mobility factor.
The absolute mobility for each compartment is computed by c_i * y_i * f_i, wher c_i is the coefficient set in MobilityParameters, y_i is the current compartment population, f_i is the factor returned by this function. This factor is optional, default 1.0. If you need to adjust mobility in that way, overload get_mobility_factors(model, t, y) for your Model type so that can be found with argument-dependent lookup.
- Parameters
-
node a node of a mobility graph. y the current value of the simulation. t the current simulation time
- Returns
- a vector expression, same size as y, with the factor for each compartment.
◆ get_month_length()
|
inline |
Computes the length of a month for a given date.
- Parameters
-
date date.
- Returns
- length of month for given date
◆ get_offset_in_days()
Computes the offset in days given two dates: first date minus second date.
- Parameters
-
date1 first date. date2 second date.
- Returns
- offset in days between the two dates.
◆ implement_dynamic_npis()
| void mio::implement_dynamic_npis | ( | DampingExprGroup & | damping_expr_group, |
| const std::vector< DampingSampling< FP >> & | npis, | ||
| SimulationTime< FP > | begin, | ||
| SimulationTime< FP > | end, | ||
| MakeMatrix && | make_matrix | ||
| ) |
implement dynamic NPIs for a time span.
Adds or removes dampings to ensure that the active dampings during the specified time span is at least as big as the specified dynamic dampings. If another damping of the same type and level is active at the beginning of the time span or becomes active during the time span, the coefficient wise maximum of the new damping and the existing damping is used. At the end of the time span, another set of dampings may be added that restores the dampings on each level and type as they would have been without the dynamic npis that have just been implemented. Examples: a) no damping exists yet, dynamic npi of value d: one damping is added at the beginning of the time span that has the value d, another damping is added at the end of the time span that has a value zero. b) damping of value a is active before the beginning of the time span, dynamic npi of value d is added: one damping is added at the beginning of the time span that has the value max(a, d), another damping is added at the end of the time span that has the value a b) damping of value a becomes active at a time t_a between the beginning of the time span and the end, dynamic npi of value d is added: one damping is added at the beginning of the time span that has the value d, the value of the damping at time t_a is set to max(d, a), another damping is added at the end of the time span that has the value a
- Parameters
-
damping_expr_group a group of matrix expressions that contains dampings, e.g. a ContactMatrixGroup. dynamic_npis the NPIs to be implemented begin beginning of the time span that the NPIs will be active for. end end of the time span that the NPIs will be active for. make_matrix function to make a matrix of the same shape as the damping expression, see e.g. make_contact_damping_matrix
◆ insert_sorted_replace() [1/2]
| void mio::insert_sorted_replace | ( | std::vector< T > & | vec, |
| T const & | item | ||
| ) |
◆ insert_sorted_replace() [2/2]
| void mio::insert_sorted_replace | ( | std::vector< T > & | vec, |
| T const & | item, | ||
| Pred | pred | ||
| ) |
inserts element in a sorted vector, replacing items that are equal precondition: elements in the vector are partially sorted and unique according the predicate postcondition: same as precondition, additionally contains exactly one element that is equal to item, order of other items is preserved
- Parameters
-
vec vector where item will be inserted item item to insert pred binary comparator, pred(item, a) returns true if item should go before element a, pred(a, item) returns true if element a should go before item
◆ interpolate_ensemble_results()
| std::vector<InterpolateResultT<T> > mio::interpolate_ensemble_results | ( | const std::vector< T > & | ensemble_results | ) |
Interpolates results of all runs with evenly spaced, integer time points that represent whole days.
- See also
- interpolate_simulation_result
- Parameters
-
ensemble_result result of multiple simulations (single TimeSeries or Graph)
- Returns
- interpolated time series, one (or as many as nodes in the graph) per result in the ensemble
◆ interpolate_simulation_result() [1/3]
| std::vector<TimeSeries<FP> > mio::interpolate_simulation_result | ( | const Graph< SimulationNode< FP, Simulation >, MobilityEdge< FP >> & | graph_result | ) |
interpolate time series with evenly spaced, integer time points for each node.
- See also
- interpolate_simulation_result
- Parameters
-
graph_result graph of simulations whose results will be interpolated
- Returns
- one interpolated time series per node
◆ interpolate_simulation_result() [2/3]
| TimeSeries< FP > mio::interpolate_simulation_result | ( | const TimeSeries< FP > & | simulation_result, |
| const FP | abs_tol = FP{100.} * Limits<FP>::zero_tolerance() |
||
| ) |
Interpolate a given time series with evenly spaced, integer time points that represent whole days.
We choose the time points for the interpolated time series using the first and last time points, t0 and tmax, as [ceil(t0 - abs_tol), floor(t0) + 1, ..., floor(tmax + abs_tol)]. The tolerances in the first and last time point account for inaccuracies from the integration scheme or floating point arithmetic. Avoid using large(r) tolerances, as this function can not extrapolate results. The values at new time points are linearly interpolated from their immediate neighbors within the given time series.
- See also
- interpolate_simulation_result
- Parameters
-
simulation_result A time series to interpolate. abs_tol Optional parameter to set the absolute tolerance used to account for small deviations from whole days. Must be less then 1. The default tolerance is chosen to minimize the chances of "loosing" days due to rounding.
- Returns
- An interpolated time series with integer valued times.
◆ interpolate_simulation_result() [3/3]
| TimeSeries< FP > mio::interpolate_simulation_result | ( | const TimeSeries< FP > & | simulation_result, |
| const std::vector< FP > & | interpolation_times | ||
| ) |
Interpolate a time series at the given time points.
New time points must be monotonic increasing, and lie in between time points of the given time series. The values at new time points are linearly interpolated from their immediate neighbors within the given time series.
- Parameters
-
simulation_result The time series to interpolate. interpolation_times An std::vector of time points at which simulation results are interpolated.
- Returns
- The interpolated time series at given interpolation points.
◆ is_leap_year()
|
inline |
Computes if a given year is a leap year.
- Parameters
-
year year as integer
- Returns
- true if year is a leap year, false otherwise
◆ linear_interpolation() [1/2]
| auto mio::linear_interpolation | ( | const X & | x_eval, |
| const X & | x_1, | ||
| const X & | x_2, | ||
| const V & | y1, | ||
| const V & | y2 | ||
| ) |
Linear interpolation between two data values.
- Parameters
-
[in] x_eval Location to evaluate interpolation. [in] x_1 Left node of interpolation. [in] x_2 Right node of interpolation. [in] y_1 Value at left node. [in] y_2 Value at right node.
- Returns
- Interpolation result.
◆ linear_interpolation() [2/2]
| TimeSeries<FP>::Vector mio::linear_interpolation | ( | FP | time, |
| const TimeSeries< FP > & | data | ||
| ) |
Linear interpolation of a TimeSeries.
Assumes that the times in the time series are monotonic increasing. If the times are strictly monotonic, this function is continuous in time. If the given interpolation time is outside of the provided time points, this function assumes a constant value of the first/last time point.
- Parameters
-
[in] time The time at which to evaluate. [in] data Time points to interpolate. At least one is required.
- Returns
- Interpolation result.
◆ linear_interpolation_of_data_set()
| Y mio::linear_interpolation_of_data_set | ( | std::vector< std::pair< X, Y >> | vector, |
| const X & | x_eval | ||
| ) |
Linear interpolation between two points of a dataset, which is represented by a vector of pairs of node and value.
Return 0 if there is less than two points in the dataset.
- Parameters
-
[in] vector Vector of pairs of node and value. [in] x_eval Location to evaluate interpolation.
- Returns
- Interpolation result.
◆ log()
|
inline |
◆ log_critical()
|
inline |
◆ log_debug()
|
inline |
◆ log_error()
|
inline |
◆ log_info()
|
inline |
◆ log_warning()
|
inline |
◆ major_size()
| Eigen::Index mio::major_size | ( | M && | m | ) |
number of rows (columns) of a row (column) major matrix.
◆ make_abm_graph_sim()
| GraphSimulation<ScalarType, Graph<ABMSimulationNode<History...>, ABMMobilityEdge<History...> >, abm::TimePoint, abm::TimeSpan, void (*)(mio::abm::TimePoint, mio::abm::TimeSpan, mio::ABMMobilityEdge<History...>&, mio::ABMSimulationNode<History...>&, mio::ABMSimulationNode<History...>&), void (*)(mio::abm::TimePoint, mio::abm::TimeSpan, mio::ABMSimulationNode<History...>&)> mio::make_abm_graph_sim | ( | abm::TimePoint | t0, |
| abm::TimeSpan | dt, | ||
| Graph< ABMSimulationNode< History... >, ABMMobilityEdge< History... >> && | graph | ||
| ) |
Creates an abm graph simulation.
Every dt time step for each edge the persons that want to change to a location in another node are removed from the model in their former location's node and added to the model of the new location.
- Parameters
-
[in] t0 Start time point of the simulation. [in] dt Step between mobility on edges. [in] graph Graph for simulation.
◆ make_contact_damping_matrix()
| auto mio::make_contact_damping_matrix | ( | V && | groups | ) |
Make a contact damping matrix from dampings by group.
Maps a vector of dampings by group onto a contact damping matrix according to the formula d_ij = 1 - sqrt((1 - g_i) * (1 - g_j)) where d_ij is a coefficient of the matrix and g_i,g_j are coefficients of the group vector. For diagonal elements (i.e. contacts of group with itself): d_ii = g_i; the damping of the corresponding group is applied directly. For off diagonal elements (i.e. contacts of group with other group): d_ij between g_i and g_j; the dampings of both groups are combined and applied equally.
- Parameters
-
groups damping value weighted by group.
- Returns
- square matrix expression of damping coefficients.
◆ make_error_code() [1/2]
|
inline |
Convert IOStatus to std::error_code.
Expected customization point of std::error_code.
◆ make_error_code() [2/2]
|
inline |
Convert StatusCode to std::error_code.
Expected customization point of std::error_code.
◆ make_graph_sim()
| auto mio::make_graph_sim | ( | Timepoint | t0, |
| Timespan | dt, | ||
| Graph && | g, | ||
| NodeF && | node_func, | ||
| EdgeF && | edge_func | ||
| ) |
◆ make_graph_sim_stochastic()
| auto mio::make_graph_sim_stochastic | ( | FP | t0, |
| FP | dt, | ||
| Graph && | g, | ||
| NodeF && | node_func, | ||
| EdgeF && | edge_func | ||
| ) |
◆ make_index_range()
| Range<MultiIndexIterator<Index<Categories...> > > mio::make_index_range | ( | Index< Categories... > | dimensions | ) |
Construct a range that can be used to iterate over all MultiIndices in the given dimensions.
The range spans over [0, d) for each category in the MultiIndex, where d is that category's value in dimensions.
- Parameters
-
[in] dimensions A MultiIndex that contains the dimension for each category.
- Template Parameters
-
Categories All categories of the given MultiIndex.
- Returns
- An iterable range over the given dimensions.
◆ make_mobility_damping_vector()
| auto mio::make_mobility_damping_vector | ( | ColumnVectorShape< FP > | shape, |
| V && | groups | ||
| ) |
Make mobility coefficient damping vector from dampings by group.
Maps the vector of dampings by group onto a mobility coefficient damping vector [g_0, g_0, ..., g_1, g_1, ..., g_2, ...].
- Parameters
-
shape shape (i.e. size) of the mobility coefficient vector. groups damping value weighted by group.
- Returns
- vector expression of mobility coefficient damping.
◆ make_mobility_sim() [1/4]
| GraphSimulation<FP, Graph<SimulationNode<FP, Sim>, MobilityEdge<FP> >, FP, FP, void (*)(FP, FP, mio::MobilityEdge<FP>&, mio::SimulationNode<FP, Sim>&, mio::SimulationNode<FP, Sim>&), void (*)(FP, FP, mio::SimulationNode<FP, Sim>&)> mio::make_mobility_sim | ( | FP | t0, |
| FP | dt, | ||
| const Graph< SimulationNode< FP, Sim >, MobilityEdge< FP >> & | graph | ||
| ) |
create a mobility-based simulation.
After every second time step, for each edge a portion of the population corresponding to the coefficients of the edge changes from one node to the other. In the next timestep, the mobile population returns to their "home" node. Returns are adjusted based on the development in the target node.
- Parameters
-
t0 start time of the simulation dt time step between mobility graph set up for mobility-based simulation
◆ make_mobility_sim() [2/4]
| GraphSimulationStochastic<FP, Graph<SimulationNode<FP, Sim>, MobilityEdgeStochastic<FP> > > mio::make_mobility_sim | ( | FP | t0, |
| FP | dt, | ||
| const Graph< SimulationNode< FP, Sim >, MobilityEdgeStochastic< FP >> & | graph | ||
| ) |
create a mobility-based simulation.
After every second time step, for each edge a portion of the population corresponding to the coefficients of the edge changes from one node to the other. In the next timestep, the mobile population returns to their "home" node. Returns are adjusted based on the development in the target node.
- Parameters
-
t0 start time of the simulation dt time step between mobility graph set up for mobility-based simulation
◆ make_mobility_sim() [3/4]
| GraphSimulation<FP, Graph<SimulationNode<FP, Sim>, MobilityEdge<FP> >, FP, FP, void (*)(FP, FP, mio::MobilityEdge<FP>&, mio::SimulationNode<FP, Sim>&, mio::SimulationNode<FP, Sim>&), void (*)(FP, FP, mio::SimulationNode<FP, Sim>&)> mio::make_mobility_sim | ( | FP | t0, |
| FP | dt, | ||
| Graph< SimulationNode< FP, Sim >, MobilityEdge< FP >> && | graph | ||
| ) |
create a mobility-based simulation.
After every second time step, for each edge a portion of the population corresponding to the coefficients of the edge changes from one node to the other. In the next timestep, the mobile population returns to their "home" node. Returns are adjusted based on the development in the target node.
- Parameters
-
t0 start time of the simulation dt time step between mobility graph set up for mobility-based simulation
◆ make_mobility_sim() [4/4]
| GraphSimulationStochastic<FP, Graph<SimulationNode<FP, Sim>, MobilityEdgeStochastic<FP> > > mio::make_mobility_sim | ( | FP | t0, |
| FP | dt, | ||
| Graph< SimulationNode< FP, Sim >, MobilityEdgeStochastic< FP >> && | graph | ||
| ) |
create a mobility-based simulation.
After every second time step, for each edge a portion of the population corresponding to the coefficients of the edge changes from one node to the other. In the next timestep, the mobile population returns to their "home" node. Returns are adjusted based on the development in the target node.
- Parameters
-
t0 start time of the simulation dt time step between mobility graph set up for mobility-based simulation
◆ make_no_mobility_sim() [1/2]
| auto mio::make_no_mobility_sim | ( | FP | t0, |
| Graph< SimulationNode< FP, Sim >, MobilityEdge< FP >> && | graph | ||
| ) |
Create a graph simulation without mobility.
Note that we set the time step of the graph simulation to infinity since we do not require any exchange between the nodes. Hence, in each node, the simulation runs until tmax when advancing the simulation without interruption.
- Parameters
-
t0 Start time of the simulation. graph Set up for graph-based simulation.
◆ make_no_mobility_sim() [2/2]
| auto mio::make_no_mobility_sim | ( | FP | t0, |
| Graph< SimulationNode< FP, Sim >, MobilityEdge< FP >> & | graph | ||
| ) |
Create a graph simulation without mobility.
Note that we set the time step of the graph simulation to infinity since we do not require any exchange between the nodes. Hence, in each node, the simulation runs until tmax when advancing the simulation without interruption.
- Parameters
-
t0 Start time of the simulation. graph Set up for graph-based simulation.
◆ make_observer()
| observer_ptr<T> mio::make_observer | ( | T * | p | ) |
◆ make_sampled_graph_simulation()
| auto mio::make_sampled_graph_simulation | ( | const Graph< typename Sim::Model, MobilityParameters< FP >> & | sampled_graph, |
| FP | t0, | ||
| FP | dt_node_sim, | ||
| FP | dt_graph_sim | ||
| ) |
Create a GraphSimulation from a parameter graph.
- Parameters
-
[in] sampled_graph A graph of models as nodes and mobility parameters as edges, with pre-sampled values. [in] t0 Start time of the graph simulation. [in] dt_node_sim (Initial) time step used by each node in the GraphSimulation. [in] dt_graph_sim Time step used by the GraphSimulation itself.
◆ map()
| auto mio::map | ( | const Rng & | v, |
| F | f | ||
| ) |
Maps a random access range (i.e.
anything with size() and operator[], e.g. std::vector) onto a Eigen array expression. Returns a column array expression ´a´ where a[i] = f(v[i]). The returned expression stores a reference to the range, lifetime of the range must exceed lifetime of the return.
- Parameters
-
v a random access range. f a function that returns a numeric scalar for each element of v.
- Returns
- an array expression ´a´ the same size as v where a[i] = f(v[i]).
◆ map_to_nonnegative()
| IOResult<void> mio::map_to_nonnegative | ( | Eigen::Ref< Eigen::VectorX< FP >> | x, |
| const FP | tolerance = Limits<FP>::zero_tolerance() |
||
| ) |
Map a vector onto nonnegative values while preserving its nonnegative sum.
Requires the vector to have a nonnegative sum to function correctly. In case of a negative sum, this function distributes the absolute sum evenly over all entries and returns an error.
- Parameters
-
[in,out] x The vector to map. [in] tolerance Absolute tolerance to check if a value is 0.
- Returns
- Returns an error if the sum was negative.
◆ max()
| auto mio::max | ( | const Eigen::MatrixBase< A > & | a, |
| B && | b | ||
| ) |
coefficient wise maximum of two matrices.
- Parameters
-
a a matrix expression b a matrix expression of the same shape as a
- Returns
- a matrix expression the shape of a with each coefficient the maximum of the coefficients of a and b.
◆ merge_time_series()
| IOResult<TimeSeries<FP> > mio::merge_time_series | ( | const TimeSeries< FP > & | ts1, |
| const TimeSeries< FP > & | ts2, | ||
| bool | add_values = false |
||
| ) |
This function merges two TimeSeries by copying their time points and values to a new TimeSeries in the correct order.
If both TimeSeries have values for the same time point, their values are either added or only one value is taken.
- Parameters
-
[in] ts1 First TimeSeries. [in] ts2 Second TimeSeries. [in] add_values Boolean specifying whether the values should be added if both TimeSeries contain the same time point. If false, the value of just the first TimeSeries is taken.
- Template Parameters
-
FP A floating point type.
- Returns
- A TimeSeries containing all time points and values from both input TimeSeries.
◆ minor_size()
| Eigen::Index mio::minor_size | ( | M && | m | ) |
number of columns (rows) of a row (column) major matrix.
◆ offset_date_by_days()
Computes the new date corresponding to a given date and a offset in days.
- Parameters
-
date date. offset_days offset in days.
- Returns
- new date that is date + offset_days.
◆ operator!=() [1/2]
| bool mio::operator!= | ( | const Edge< T > & | e1, |
| const Edge< T > & | e2 | ||
| ) |
◆ operator!=() [2/2]
| bool mio::operator!= | ( | const Node< T > & | n1, |
| const Node< T > & | n2 | ||
| ) |
◆ operator<<()
| requires HasOstreamOperator<T> std::ostream& mio::operator<< | ( | std::ostream & | os, |
| const Edge< T > & | e | ||
| ) |
out stream operator for edges if edge property type has stream operator defined
◆ operator==() [1/2]
| bool mio::operator== | ( | const Edge< T > & | e1, |
| const Edge< T > & | e2 | ||
| ) |
comparison operator if edge property type is equality comparable
◆ operator==() [2/2]
| bool mio::operator== | ( | const Node< T > & | n1, |
| const Node< T > & | n2 | ||
| ) |
comparison operator if node property type is equality comparable
◆ parse_date()
parses a date from a string.
uses fixed format YYYY.MM.DD or YYYY-MM-DD.
- Parameters
-
date_str date as a string.
- Returns
- parsed date.
◆ path_join()
| std::string mio::path_join | ( | String && | base, |
| Strings &&... | app | ||
| ) |
join one ore more strings with path separators.
Accepts mixed C strings or std::strings.
example:
std::string hello("Hello");
auto p = path_join(hello, "World"); //returns "Hello/World"
- Parameters
-
base first string app zero or more other strings
- Returns
- all inputs joined
◆ print_graph()
| void mio::print_graph | ( | std::ostream & | os, |
| const Graph & | g | ||
| ) |
◆ print_graph_object()
| requires HasOstreamOperator<T> void mio::print_graph_object | ( | std::ostream & | os, |
| size_t | idx, | ||
| const T & | o | ||
| ) |
◆ PrintTo() [1/2]
◆ PrintTo() [2/2]
|
inline |
◆ Range() [1/2]
| mio::Range | ( | std::pair< I, S > | iterator_pair | ) | -> Range< I, S > |
Deduction guide to correctly deduce range type when constructed from a pair.
◆ Range() [2/2]
| mio::Range | ( | T && | range | ) | -> Range< decltype(range.begin()), decltype(range.end())> |
Deduction guide to correctly deduce range type when constructed from another range.
◆ read_mobility_formatted()
| IOResult< Eigen::MatrixXd > mio::read_mobility_formatted | ( | const std::string & | filename | ) |
Reads formatted mobility or contact data which is given in columns from_str to_str from_rs to_rs count_abs and separated by tabs.
Writes it into a NxN Eigen Matrix, where N is the number of regions
- Parameters
-
filename name of file to be read
◆ read_mobility_plain()
| IOResult< Eigen::MatrixXd > mio::read_mobility_plain | ( | const std::string & | filename | ) |
Reads txt mobility data or contact which is given by values only and separated by spaces.
Writes it into a NxN Eigen Matrix, where N is the number of regions
- Parameters
-
filename name of file to be read
◆ reduce_index() [1/2]
| decltype(auto) mio::reduce_index | ( | const SuperIndex & | index | ) |
Create a SubIndex by copying values from SuperIndex.
If a type T is contained multiple times in SuperIndex, only the first occurance of T is used. For example, reduce_index<Index<T, T>>(Index<T, T, T>{1,2,3}) returns {1,1}.
- Parameters
-
[in] index An instance of SuperIndex
- Template Parameters
-
SubIndex An Index that contains a subset of the categories from SuperIndex. SuperIndex Any Index.
- Returns
- A (sub)index with the given categories and values from index.
◆ reduce_index() [2/2]
| requires std::is_enum_v<Enum> Index<Enum> mio::reduce_index | ( | const SuperIndex & | index | ) |
Create a SubIndex by copying values from SuperIndex.
If a type T is contained multiple times in SuperIndex, only the first occurance of T is used. For example, reduce_index<Index<T, T>>(Index<T, T, T>{1,2,3}) returns {1,1}.
- Parameters
-
[in] index An instance of SuperIndex
- Template Parameters
-
SubIndex An Index that contains a subset of the categories from SuperIndex. SuperIndex Any Index.
- Returns
- A (sub)index with the given categories and values from index.
◆ requires() [1/3]
| mio::requires | ( | !HasOstreamOperator< T > | ) |
out stream operator for edges if edge property type does not have stream operator defined
◆ requires() [2/3]
| mio::requires | ( | !HasSerialize< IOContext, Container > | ) | & |
serialize an STL compatible container.
deserialize an STL compatible container.
- Template Parameters
-
IOContext a type that models the IOContext concept. Container the container type to be serialized. A container is anything with begin and end iterators.
- Parameters
-
io an IO context. container a container to be serialized.
- Template Parameters
-
IOContext a type that models the IOContext concept. Container the container type to be deserialized. A container is anything with begin and end iterators.
- Parameters
-
io an IO context. tag defines the type of the container to be serialized for overload resolution.
- Returns
- restored container if successful, error otherwise.
◆ requires() [3/3]
| mio::requires | ( | !std::is_trivial_v< T > | ) |
◆ reshape()
| auto mio::reshape | ( | M && | m, |
| Eigen::Index | rows, | ||
| Eigen::Index | cols | ||
| ) |
reshape the matrix.
Total number of entries before and after the reshape must be the same. The new matrix shares memory with the input matrix, no copying is performed, changes to the new matrix will be made to the input matrix as well. Assign to another matrix of compatible size if you need a copy.
- Parameters
-
m matrix to reshape rows number of rows of the new matrix cols number of cols of the new matrix
- Returns
- matrix expression with the same entries as the input matrix but new shape
◆ result_distance_2norm() [1/2]
| FP mio::result_distance_2norm | ( | const std::vector< mio::TimeSeries< FP >> & | result1, |
| const std::vector< mio::TimeSeries< FP >> & | result2 | ||
| ) |
Compute the distance between two SECIR simulation results.
The distance is the 2-norm of the element-wise difference of the two results. The two results (e.g. output of interpolate_simulation_result) must have the same dimensions and number of time points.
- Parameters
-
result1 first result. result2 second result.
- Returns
- Computed distance between result1 and result2.
◆ result_distance_2norm() [2/2]
| FP mio::result_distance_2norm | ( | const std::vector< mio::TimeSeries< FP >> & | result1, |
| const std::vector< mio::TimeSeries< FP >> & | result2, | ||
| InfectionState | compartment | ||
| ) |
Compute the distance between two compartment model simulation results in one compartment.
The distance is the 2-norm of the element-wise difference of the two results in the specified compartment. The two results (e.g. output of interpolate_simulation_result) must have the same dimensions and number of time points.
- Template Parameters
-
InfectionState enum type that defines the compartments of the model that produced the results.
- Parameters
-
result1 first result. result2 second result. compartment the compartment to compare.
- Returns
- Computed distance between result1 and result2.
◆ serialize()
| void mio::serialize | ( | IOContext & | io, |
| const T & | t | ||
| ) |
Save data that describes an object in a format determined by the given context.
There must be provided for the type T either a free function serialize_internal(io, t) that can be found using argument dependent lookup (ADL) or a member function t.serialize(io). The serialize_internal function or serialize member function provide the data that describes the object to the io context. The context stores the data in some unspecified format so that the objects can be reconstructed from it. The context also keeps track of any IO errors. serialize_internal overloads are already provided for many common types, e.g. STL containers or Eigen Matrices. serialize and deserialize are the main entry point into this IO framework, but there may be more convenient functions provided for specific IO contexts. These functions are not expected to use ADL, so should be called namespace qualified.
- Template Parameters
-
IOContext a type that models the IOContext concept. T any serializable type, i.e., that has a serializemember function orserialize_internaloverload
- Parameters
-
io io context that stores data from the object t in some unspecified format. t the object to be stored.
◆ serialize_binary()
| ByteStream mio::serialize_binary | ( | const T & | t, |
| int | flags = 0 |
||
| ) |
Serialize an object into binary format.
The format is not portable, object must be deserialized by the same (or identically compiled) program.
- Parameters
-
t object to serialize.
- Returns
- a ByteStream that contains the serialized bytes that represent the object.
- Template Parameters
-
T the type of the object to be serialized.
◆ serialize_internal() [1/5]
| void mio::serialize_internal | ( | IOContext & | io, |
| const Eigen::EigenBase< M > & | mat | ||
| ) |
◆ serialize_internal() [2/5]
| void mio::serialize_internal | ( | IOContext & | io, |
| const std::bitset< N > | bitset | ||
| ) |
Serialize an std::bitset.
- Template Parameters
-
IOContext A type that models the IOContext concept. N The size of the bitset.
- Parameters
-
io An IO context. bitset A bitset to be serialized.
◆ serialize_internal() [3/5]
| void mio::serialize_internal | ( | IOContext & | io, |
| const T & | t | ||
| ) |
Serialization implementation for the default serialization feature.
serialize an object that has a serialize(io) member function.
Disables itself (SFINAE) if there is no default_serialize member or if a serialize member is present. Generates the serialize method depending on the NamedRefs given by default_serialize.
- Template Parameters
-
IOContext A type that models the IOContext concept. DefaultSerializable A type that can be default serialized.
- Parameters
-
io An IO context. a An instance of DefaultSerializable to be serialized.
- Template Parameters
-
IOContext a type that models the IOContext concept. T the Type of the object to be serialized. Must have a serialize member function.
- Parameters
-
io an IO context t the object to be serialized.
◆ serialize_internal() [4/5]
| requires std::same_as<Tup<T...>, std::pair<T...> > std::same_as<Tup<T...>, std::tuple<T...> > void mio::serialize_internal | ( | IOContext & | io, |
| const Tup< T... > & | tup | ||
| ) |
serialize a tuple-like object, e.g.
std::tuple or std::pair.
- Template Parameters
-
IOContext a type that models the IOContext concept. Tup the tuple-like type to be serialized, i.e. anything that supports tuple_size and tuple_element.
- Parameters
-
io an IO context. tup a tuple-like object to be serialized.
◆ serialize_internal() [5/5]
| requires std::is_enum_v<E> void mio::serialize_internal | ( | IOContext & | io, |
| E | e | ||
| ) |
serialize an enum value as its underlying type.
- Template Parameters
-
IOContext a type that models the IOContext concept. E an enum type to be serialized.
- Parameters
-
io an IO context e an enum value to be serialized.
◆ set_edges()
| IOResult<void> mio::set_edges | ( | const fs::path & | mobility_data_file, |
| Graph< Model, MobilityParams > & | params_graph, | ||
| std::initializer_list< InfectionState > & | mobile_compartments, | ||
| size_t | contact_locations_size, | ||
| ReadFunction && | read_func, | ||
| std::vector< FP > | commuting_weights, | ||
| std::vector< std::vector< size_t >> | indices_of_saved_edges = {} |
||
| ) |
Sets the graph edges.
Reads the commuting matrices from txt files and sets the graph edges with that.
- Parameters
-
[in] mobility_data_file File that contains the commuting matrix. [in,out] params_graph Graph whose nodes are set by the function. [in] mobile_compartments Compartments that commute. [in] contact_locations_size Number of contact locations. [in] read_func Function that reads commuting matrices. [in] commuting_weights Vector with a commuting weight for every AgeGroup. [in] indices_of_saved_edges Vector of vectors with indices of the compartments that should be saved on the edges.
◆ set_log_level()
|
inline |
Sets the verbosity of the logger.
◆ set_nodes()
| IOResult<void> mio::set_nodes | ( | const Parameters & | params, |
| Date | start_date, | ||
| Date | end_date, | ||
| const fs::path & | data_dir, | ||
| const std::string & | population_data_path, | ||
| bool | is_node_for_county, | ||
| Graph< Model, MobilityParams > & | params_graph, | ||
| ReadFunction && | read_func, | ||
| NodeIdFunction && | node_func, | ||
| const std::vector< FP > & | scaling_factor_inf, | ||
| FP | scaling_factor_icu, | ||
| FP | tnt_capacity_factor, | ||
| int | num_days = 0, |
||
| bool | export_time_series = false, |
||
| bool | rki_age_groups = true |
||
| ) |
Sets the graph nodes for counties or districts.
Reads the node ids which could refer to districts or counties and the epidemiological data from json files and creates one node for each id. Every node contains a model.
- Parameters
-
[in] params Model Parameters that are used for every node. [in] start_date Start date for which the data should be read. [in] end_data End date for which the data should be read. [in] data_dir Directory that contains the data files. [in] population_data_path Path to json file containing the population data. [in] is_node_for_county Specifies whether the node ids should be county ids (true) or district ids (false). [in,out] params_graph Graph whose nodes are set by the function. [in] read_func Function that reads input data for german counties and sets Model compartments. [in] node_func Function that returns the county ids. [in] scaling_factor_inf Factor of confirmed cases to account for undetected cases in each county. [in] scaling_factor_icu Factor of ICU cases to account for underreporting. [in] tnt_capacity_factor Factor for test and trace capacity. [in] num_days Number of days to be simulated; required to load data for vaccinations during the simulation. [in] export_time_series If true, reads data for each day of simulation and writes it in the same directory as the input files. [in] rki_age_groups Specifies whether rki-age_groups should be used.
◆ set_ostream_format()
|
inline |
Adds manipulators for width, (fixed) precision and fill character to an ostream.
Note that the formatting is consumed by the first output given to the ostream.
- Parameters
-
out Any std::ostream. width Minimum width of the output. precision The exact number of decimals (used only for numbers). fill [Default: A space ' '] The character used for padding.
- Returns
- Returns a reference to out.
◆ simulate()
| TimeSeries<FP> mio::simulate | ( | FP | t0, |
| FP | tmax, | ||
| FP | dt, | ||
| Model const & | model, | ||
| std::unique_ptr< OdeIntegratorCore< FP >> && | integrator_core = nullptr |
||
| ) |
Run a Simulation of a CompartmentalModel.
- Parameters
-
[in] t0 Start time. [in] tmax End time. [in] dt Initial step size of integration. [in] model An instance of a CompartmentalModel. [in] integrator_core Optionally override the IntegratorCore used by the Simulation.
- Returns
- A TimeSeries to represent the final Simulation result
- Template Parameters
-
FP floating point type, e.g., double Model The particular Model derived from CompartmentModel to simulate. Sim A Simulation that can simulate the model.
◆ simulate_flows()
| std::vector<TimeSeries<FP> > mio::simulate_flows | ( | FP | t0, |
| FP | tmax, | ||
| FP | dt, | ||
| Model const & | model, | ||
| std::unique_ptr< OdeIntegratorCore< FP >> && | integrator_core = nullptr |
||
| ) |
Run a FlowSimulation of a FlowModel.
- Parameters
-
[in] t0 Start time. [in] tmax End time. [in] dt Initial step size of integration. [in] model An instance of a FlowModel. [in] integrator_core Optionally override the IntegratorCore used by the FlowSimulation.
- Returns
- The simulation result as two TimeSeries. The first describes the compartments at each time point, the second gives the corresponding flows that lead from t0 to each time point.
- Template Parameters
-
FP a floating point type, e.g., double Model The particular Model derived from FlowModel to simulate. Sim A FlowSimulation that can simulate the model.
◆ simulate_stochastic()
| TimeSeries<FP> mio::simulate_stochastic | ( | FP | t0, |
| FP | tmax, | ||
| FP | dt, | ||
| Model const & | model, | ||
| std::unique_ptr< SdeIntegratorCore< FP >> && | integrator_core = nullptr |
||
| ) |
◆ slice() [1/2]
| auto mio::slice | ( | M && | m, |
| Seq< Eigen::Index > | rows, | ||
| Seq< Eigen::Index > | cols | ||
| ) |
take a regular slice of a matrix.
The slices shares the same memory as the original matrix, no copying is performed, changes to the slice are also made to the original matrix. Assign to a different matrix of compatible size if you need a copy.
- Parameters
-
m Matrix to take a slice of rows sequence of row indices cols sequence of column indices
- Returns
- matrix expression with selected entries from the input matrix
◆ slice() [2/2]
| auto mio::slice | ( | V && | v, |
| Seq< Eigen::Index > | elems | ||
| ) |
take a regular slice of a row or column vector.
The slices shares the same memory as the original vector, no copying is performed, changes to the slice are also made to the original vector. Assign to a different vector of compatible size if you need a copy.
- Parameters
-
v Row or column vector to take a slice of elems sequence of row or column indices
- Returns
- vector expression with selected entries from the input vector
◆ smoother_cosine() [1/2]
| auto mio::smoother_cosine | ( | FP | x, |
| FP | xleft, | ||
| FP | xright, | ||
| const Eigen::MatrixBase< LeftExpr > & | yleft_expr, | ||
| const Eigen::MatrixBase< RightExpr > & | yright_expr | ||
| ) |
smoother_cosine as a matrix valued function.
- Parameters
-
x evaluation point xleft left boundary x xright right boundary x yleft matrix expression, function value at left boundary yright matrix expression, function value at right boundary
- Returns
- a matrix expression with yij = smoother_cosine(x, xleft, xright, yleftij, yrightij)
◆ smoother_cosine() [2/2]
|
inline |
Returns the smoothed evaluation of a discrete jump of function values
yleft and yright on xleft and xright, respectively, by using a cosine function.
If the input value is outside the given interval, yleft or yright are returned, respectively. { yleft, for x <= xleft f(x) = { yright, for x >= xright { 0.5*(yleft - yright)*cos(pi/(xright-xleft)*(x-xleft))+0.5*(yleft + yright) for x\in[xleft,xright]
- Parameters
-
x current evaluation point xleft left boundary of independent variable xright right boundary of independent variable yleft function value at left boundary yright function value at right boundary
- Returns
- Floating point cosine-smoothed evaluation of discrete step function
◆ split()
| std::vector< std::string > mio::split | ( | const std::string & | s, |
| char | delimiter | ||
| ) |
Splits string into a Vector of strings according to delimiter.
- Parameters
-
s string which is splitted delimiter sign at which to split string
◆ status_code_category()
|
inline |
singleton StatusCodeCategory instance.
◆ StringLiteral()
| mio::StringLiteral | ( | const char(&) | string[Size] | ) | -> StringLiteral< Size - 1 > |
◆ success() [1/2]
|
inline |
Create an object that is implicitly convertible to a succesful IOResult<void>.
Use return success() to conveniently return a successful result from a function.
◆ success() [2/2]
| auto mio::success | ( | T && | t | ) |
Create an object that is implicitly convertible to a succesful IOResult.
Use return success(t) to conveniently return a successful result from a function.
- Parameters
-
t a value that is convertible to the value type of the IOResult
◆ sum_nodes()
| std::vector< std::vector< TimeSeries< FP > > > mio::sum_nodes | ( | const std::vector< std::vector< TimeSeries< FP >>> & | ensemble_result | ) |
◆ test_commuters()
| void mio::test_commuters | ( | SimulationNode< FP, Sim > & | node, |
| Eigen::Ref< Eigen::VectorX< FP >> | mobile_population, | ||
| FP | time | ||
| ) |
Test persons when moving from their source node.
May transfer persons between compartments, e.g., if an infection was detected. This feature is optional, default implementation does nothing. In order to support this feature for your model, implement a test_commuters overload that can be found with argument-dependent lookup.
- Parameters
-
node a node of a mobility graph. mobile_population mutable reference to vector of persons per compartment that change nodes. t the current simulation time.
◆ thread_local_rng()
| RandomNumberGenerator& mio::thread_local_rng | ( | ) |
◆ unused()
| void mio::unused | ( | T && | ... | ) |
Does nothing, can be used to mark variables as not used.
Intended for avoiding compiler warnings/error about unused variables.
Variable Documentation
◆ container
| const Container& mio::container |
◆ has_duplicates_v
|
constexpr |
Checks whether Type has any duplicates.
Equivalent to has_duplicates<Types...>::value.
- See also
- is_type_in_list.
◆ HasApplyConstraints
| concept mio::HasApplyConstraints |
Check that the given type has an apply_constraints member function.
◆ HasCheckConstraints
| concept mio::HasCheckConstraints |
Check that the given type has a check_constraints member function.
◆ HasDeserialize
| concept mio::HasDeserialize |
◆ HasOstreamOperator
| concept mio::HasOstreamOperator = requires(std::ostream os, T t) { os << t; } |
Concept to check if type T has an existing stream output operator "<<".
◆ HasSerialize
| concept mio::HasSerialize = requires(IOContext& ctxt, const T& t) { t.serialize(ctxt); } |
◆ i
| auto mio::i = obj.expect_list("Items", Tag<typename Container::value_type>{}) |
◆ index_of_type_v
|
constexpr |
The index of Type in the list Types.
Equivalent to index_of_type<Type, Types...>::value.
- See also
- index_of_type.
◆ is_ad_type_v
|
constexpr |
◆ is_type_in_list_v
|
constexpr |
Checks whether Type is in the list Types.
Equivalent to is_type_in_list<Type, Types...>::value.
- See also
- is_type_in_list.
◆ IsCompartmentalModel
| concept mio::IsCompartmentalModel |
Concept to check if a type is a valid compartment model.
Note that Model must be the first template argument
- Template Parameters
-
Model A type that may or may not be a compartment model. FP A floating point type, e.g. double.
◆ IsCompartmentalModelSimulation
| concept mio::IsCompartmentalModelSimulation |
Concept to check if a type is a simulation for a compartmental model.
- Template Parameters
-
Simulation A type that may or may not be a compartmental model simulation. FP A floating point type, e.g., double.
◆ IsContainer
| concept mio::IsContainer |
Concept to check whether C is a STL compatible container.
See https://en.cppreference.com/w/cpp/named_req/Container.
- Template Parameters
-
C any type.
◆ IsDefaultDeserializable
| concept mio::IsDefaultDeserializable |
Detect whether T has a default_serialize member function, but no deserialize member.
- Template Parameters
-
T Any type. IOContext Any context, e.g. JsonContext.
◆ IsDefaultSerializable
| concept mio::IsDefaultSerializable |
Detect whether T has a default_serialize member function, but no serialize member.
- Template Parameters
-
T Any type. IOContext Any context, e.g. JsonContext.
◆ IsDynamicMatrix
| concept mio::IsDynamicMatrix |
check if Eigen::Matrix type M is a dynamic matrix type.
◆ IsDynamicVector
| concept mio::IsDynamicVector |
check if Eigen::Matrix type M is a dynamic vector type.
◆ IsFlowModel
| concept mio::IsFlowModel |
Concept to check if a type is a valid FlowModel.
Note that Model must be the first template argument
- Template Parameters
-
Model A type that may or may not be a FlowModel. FP A floating point type, e.g. double.
◆ IsMatrixExpression
| concept mio::IsMatrixExpression = std::is_base_of_v<Eigen::EigenBase<M>, M> |
Concept to detect whether T is an Eigen matrix expression.
◆ IsMultiIndex
| concept mio::IsMultiIndex = requires(Index<CategoryTags...> i) { details::is_multi_index_impl(i); } |
A MultiIndex is an Index with any number of categories. Does accept empty or single category indices.
◆ IsStochasticModel
| concept mio::IsStochasticModel |
Concept to check if a type is a valid stochastic model.
Note that Model must be the first template argument
- Template Parameters
-
Model A type that may or may not be a stochastic model. FP A floating point type, e.g. double.
◆ Tag< Container >
| mio::Tag< Container > |
Generated by