temporal_hybrid_model.h Source File
|
CPP API
|
temporal_hybrid_model.h
Go to the documentation of this file.
63 //Should return true when the simulation should be continued with the model that is not used currently i.e. a switch needs to be applied
65 std::function<bool(const ResultType1& state_model1, const ResultType2& state_model2, bool model1_used)>;
106 condition) { //currently model2 is used, but the condition to switch is fulfilled i.e. we need to switch to model1
A temporal-hybrid simulation.
Definition: temporal_hybrid_model.h:56
bool m_using_model1
Boolean specifying whether model 1 is currently used for simulation.
Definition: temporal_hybrid_model.h:181
TemporalHybridSimulation(Model1 &&model1, Model2 &&model2, const result1_function &result1, const result2_function &result2, bool initially_use_model1, ScalarType t0=0, ScalarType dt=0.1)
Create a temporal-hybrid simulation.
Definition: temporal_hybrid_model.h:77
Model1 m_model1
First model used for the simulation.
Definition: temporal_hybrid_model.h:177
auto & get_model1()
Definition: temporal_hybrid_model.h:147
ResultType1 get_result_model1() const
Get the result of model 1.
Definition: temporal_hybrid_model.h:126
const auto & get_model1() const
Returns first model used for the simulation.
Definition: temporal_hybrid_model.h:143
std::function< ResultType1(const Model1 &, ScalarType t)> result1_function
Definition: temporal_hybrid_model.h:60
const auto & using_model1() const
Returns whether the first model is currently used for simulation.
Definition: temporal_hybrid_model.h:167
ResultType2 get_result_model2() const
Get the result of model 2.
Definition: temporal_hybrid_model.h:135
std::function< ResultType2(const Model2 &, ScalarType t)> result2_function
Definition: temporal_hybrid_model.h:61
ScalarType m_dt
Step size with which the switching condition is checked.
Definition: temporal_hybrid_model.h:183
auto & get_model2()
Definition: temporal_hybrid_model.h:159
void advance(ScalarType tmax, const switching_condition &switch_model)
Advance simulation to tmax.
Definition: temporal_hybrid_model.h:95
ScalarType m_t
Current time step.
Definition: temporal_hybrid_model.h:182
result2_function m_result2
Result function of second model.
Definition: temporal_hybrid_model.h:180
const auto & get_model2() const
Returns second model used for the simulation.
Definition: temporal_hybrid_model.h:155
std::function< bool(const ResultType1 &state_model1, const ResultType2 &state_model2, bool model1_used)> switching_condition
Definition: temporal_hybrid_model.h:65
result1_function m_result1
Result function of first model.
Definition: temporal_hybrid_model.h:179
Model2 m_model2
Second model used for the simulation.
Definition: temporal_hybrid_model.h:178
auto & using_model1()
Definition: temporal_hybrid_model.h:171
static min_max_return_type< ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > >::type min(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &a, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &b)
Definition: ad.hpp:2599
void convert_model(const dabm::Simulation< SingleWell< mio::osecir::InfectionState >> ¤t_model, smm::Simulation< ScalarType, mio::osecir::InfectionState > &target_model)
Definition: conversion_functions.cpp:38
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
Definition: io.h:94
Generated by