|
| | Simulation ()=delete |
| |
| | Simulation (SimulationModuleFactory &factory, std::shared_ptr< const EventAggregator > bus, std::shared_ptr< const ModelInput > inputs, std::unique_ptr< Scenario > scenario) |
| | Initialises a new instance of the Simulation class.
|
| |
| virtual | ~Simulation ()=default |
| | Destroys a simulation instance.
|
| |
| adevs::Time | init (adevs::SimEnv< int > *env) override |
| | Called when the model is added to the simulation executive.
|
| |
| adevs::Time | update (adevs::SimEnv< int > *env) override |
| | Called to assign a new state to the model at current time.
|
| |
| adevs::Time | update (adevs::SimEnv< int > *env, std::vector< int > &x) override |
| | Called to assign a new state to the model at current time, when input is present.
|
| |
| void | fini (adevs::Time clock) override |
| | Called after the model has been removed from the simulation executive.
|
| |
| void | setup_run (unsigned int run_number, unsigned int seed) noexcept |
| | Set up a new simulation run.
|
| |
| ScenarioType | type () noexcept |
| | Gets the simulation type.
|
| |
| std::string | name () override |
| | Gets the simulation name.
|
| |
Defines the simulation engine data type class.
The simulation engine holds the modules instances and run-time context, manages the simulation clock and core algorithm sequencing.
Health-GPS uses a simpler version of adevs (A Discrete EVent System simulator) library (https://sourceforge.net/projects/bdevs), which contain only four header files, but provides an intuitive modelling interface for agent-based models, without requiring familiarity with the full aspects of the DEVS formalism.
| adevs::Time hgps::Simulation::update |
( |
adevs::SimEnv< int > * |
env, |
|
|
std::vector< int > & |
x |
|
) |
| |
|
override |
Called to assign a new state to the model at current time, when input is present.
This is not used with Health-GPS, the individuals are independent and nobody sends messages. If needed by future scenarios, e.g., agent-based models, the input was generated in the previous simulation instant and so this calculates the new state using state information from the previous instant.
- Parameters
-
| env | The simulation executive environment |
| x | Messages sent to the model. |
- Returns
- The time of the next call to update.