flow_simulation.h Source File
|
CPP API
|
flow_simulation.h
Go to the documentation of this file.
64 // the derivfunktion (i.e. the lambda passed to m_integrator.advance below) requires that there are at least
72 // flows contains the accumulated outflows of each compartment for each target compartment at time t.
73 // Using that the ODEs are linear expressions of the flows, get_derivatives can compute the total change
75 // To incorporate external changes to the last values of pop_result (e.g. by applying mobility), we only
76 // calculate the change in population starting from the last available time point in m_result, instead
81 // If no changes were made to the last value in m_result outside of FlowSimulation, the following
82 // line computes the same as `model.get_derivatives(flows, x); x += model.get_initial_values();`.
Eigen::VectorX< FP > m_pop
pre-allocated temporary, used during computation of flow derivatives
Definition: flow_simulation.h:94
Eigen::Ref< Eigen::VectorX< FP > > advance(FP tmax)
Run the simulation up to a given time.
Definition: flow_simulation.h:62
FlowSimulation(Model const &model, FP t0=0., FP dt=0.1)
Set up the simulation with an ODE solver.
Definition: flow_simulation.h:49
Interface class defining the integration step used in a SystemIntegrator.
Definition: integrator.h:48
Base class to define a FlowSimulation.
Definition: flow_simulation_base.h:42
void compute_population_results()
Computes the distribution of the Population to the InfectionStates based on the simulated flows.
Definition: flow_simulation_base.h:90
TimeSeries< FP > & get_flows()
Returns the simulation result describing the transitions between compartments for each time step.
Definition: flow_simulation_base.h:72
Eigen::Ref< Eigen::VectorX< FP > > advance(const Integrands &... fs, FP tmax, TimeSeries< FP > &results)
Run the simulation up to a given time.
Definition: simulation_base.h:165
const Model & get_model() const
Get a reference to the model owned and used by the simulation.
Definition: simulation_base.h:131
TimeSeries< FP > & get_result()
Returns the simulation result describing the model population in each time step.
Definition: simulation_base.h:116
int size(Comm comm)
Return the size of the given communicator.
Definition: miompi.cpp:75
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
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.
Definition: flow_simulation.h:111
Definition: io.h:94
Generated by