result_simulation.h Source File

CPP API: result_simulation.h Source File
result_simulation.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2020-2026 MEmilio
3 *
4 * Authors: Rene Schmieding
5 *
6 * Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20 
21 #include "abm/common_abm_loggers.h"
22 #include "abm/simulation.h"
23 
24 namespace mio
25 {
26 namespace abm
27 {
28 
30 template <class M = Model>
31 class ResultSimulation : public Simulation<M>
32 {
33 public:
34  using Model = M;
35 
38  : Simulation<Model>(t, std::move(m))
39  {
40  }
41 
46  void advance(TimePoint tmax)
47  {
49  }
50 
55  {
56  return get<0>(history.get_log());
57  }
58 
60  Eigen::Index(InfectionState::Count)};
61 };
62 
63 } // namespace abm
64 } // namespace mio
History class that handles writers and loggers.
Definition: history.h:70
stores vectors of values at time points (or some other abstract variable) the value at each time poin...
Definition: time_series.h:58
Simulation holding its own History to provide a get_result member. Can be used for a ParameterStudy.
Definition: result_simulation.h:32
const mio::TimeSeries< double > & get_result() const
Return the simulation result aggregated by infection states.
Definition: result_simulation.h:54
M Model
Definition: result_simulation.h:34
void advance(TimePoint tmax)
Run the simulation until the given time point.
Definition: result_simulation.h:46
ResultSimulation(Model &&m, TimePoint t)
Create a simulation, moving the model.
Definition: result_simulation.h:37
mio::History< TimeSeriesWriter, LogInfectionState > history
History used to create the result TimeSeries.
Definition: result_simulation.h:59
Run the Simulation in discrete steps, evolve the Model and report results.
Definition: models/abm/simulation.h:37
void advance(TimePoint tmax, History &... history)
Run the Simulation from the current time to tmax.
Definition: models/abm/simulation.h:70
Represents a point in time.
Definition: time.h:175
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
Definition: io.h:94