Simulation< Implementation > Class Template Reference
|
CPP API
|
Classes |
Public Types |
Public Member Functions |
Private Types |
Private Member Functions |
Private Attributes |
List of all members
mio::dabm::Simulation< Implementation > Class Template Reference
A specialized Simulation for mio::dabm::Model. More...
#include <simulation.h>
Collaboration diagram for mio::dabm::Simulation< Implementation >:
Classes | |
| struct | Event |
| Struct defining an adoption event for an agent and target infection state. More... | |
Public Types | |
| using | Model = dabm::Model< Implementation > |
Public Member Functions | |
| void | advance (const ScalarType t_max) |
| Advance simulation to tmax. More... | |
| Model & | get_model () |
| const Model & | get_model () const |
| Returns the model used in the simulation. More... | |
| TimeSeries< ScalarType > & | get_result () |
| Returns the final simulation result. More... | |
| const TimeSeries< ScalarType > & | get_result () const |
| Simulation (const Model &model, ScalarType t0=0, ScalarType dt=0.1) | |
| Set up the simulation for a diffusive ABM. More... | |
Private Types | |
| using | Status = typename Implementation::Status |
Private Member Functions | |
| void | compute_current_rates_and_events () |
| Calculate current values for m_current_rates and m_current_events. More... | |
Private Attributes | |
| std::vector< Event > | m_current_events |
| Contains an event corresponding to each rate in m_current_rates. More... | |
| std::vector< ScalarType > | m_current_rates |
| Current adoption rates. More... | |
| ScalarType | m_dt |
| Start time of the simulation and integration step size. More... | |
| std::unique_ptr< Model > | m_model |
| Pointer to the model used in the simulation. More... | |
| mio::TimeSeries< ScalarType > | m_result |
| Result time series. More... | |
| ScalarType | m_t0 |
Detailed Description
template<class Implementation>
class mio::dabm::Simulation< Implementation >
A specialized Simulation for mio::dabm::Model.
- Template Parameters
-
Implementation A class implementing all functions and types marked with the using keyword in Model, see dabm::Model.
Member Typedef Documentation
◆ Model
template<class Implementation >
| using mio::dabm::Simulation< Implementation >::Model = dabm::Model<Implementation> |
◆ Status
template<class Implementation >
|
private |
Constructor & Destructor Documentation
◆ Simulation()
template<class Implementation >
|
inline |
Set up the simulation for a diffusive ABM.
- Parameters
-
[in] model An instance of mio::dabm::Model. [in] t0 Start time. [in] dt Step size of integration.
Member Function Documentation
◆ advance()
template<class Implementation >
|
inline |
Advance simulation to tmax.
This function performs a temporal Gillespie.
- Parameters
-
tmax Next stopping point of simulation.
◆ compute_current_rates_and_events()
template<class Implementation >
|
inlineprivate |
Calculate current values for m_current_rates and m_current_events.
◆ get_model() [1/2]
template<class Implementation >
|
inline |
◆ get_model() [2/2]
template<class Implementation >
|
inline |
Returns the model used in the simulation.
◆ get_result() [1/2]
template<class Implementation >
|
inline |
Returns the final simulation result.
- Returns
- A TimeSeries to represent the final simulation result.
◆ get_result() [2/2]
template<class Implementation >
|
inline |
Member Data Documentation
◆ m_current_events
template<class Implementation >
|
private |
Contains an event corresponding to each rate in m_current_rates.
◆ m_current_rates
template<class Implementation >
|
private |
Current adoption rates.
◆ m_dt
template<class Implementation >
|
private |
Start time of the simulation and integration step size.
◆ m_model
template<class Implementation >
|
private |
Pointer to the model used in the simulation.
◆ m_result
template<class Implementation >
|
private |
Result time series.
◆ m_t0
template<class Implementation >
|
private |
Generated by