|
Stride Reference Manual
- generated for commit 9643b11
|
The simulation runner drive simulator throufgh time steps. More...
#include <SimRunner.h>


Public Member Functions | |
| SimRunner (const boost::property_tree::ptree &configPt, std::shared_ptr< Sim > sim) | |
| Initialization with property tree. More... | |
| ~SimRunner () override=default | |
| Destructor. More... | |
| const util::Stopwatch & | GetClock () const |
| Return the run & sim configuration. More... | |
| const boost::property_tree::ptree & | GetConfig () const |
| Return the run & sim configuration. More... | |
| std::shared_ptr< Sim > | GetSim () const |
| Return the Simulator. More... | |
| void | Run () |
| Run simulator for as many steps/days as indicated in config. More... | |
| void | Run (unsigned int numSteps) |
| Run simulator for numSteps steps/days. More... | |
Public Member Functions inherited from stride::util::Subject< stride::sim_event::Id > | |
| Subject () | |
| virtual | ~Subject () |
| void | Register (const std::shared_ptr< U > &u, CallbackType f) |
| void | Unregister (const std::shared_ptr< U > &u) |
| void | UnregisterAll () |
| void | Notify (const EventType &e) |
Private Attributes | |
| util::Stopwatch | m_clock |
| Stopwatch for timing the computation. More... | |
| boost::property_tree::ptree | m_config |
| Ptree with configuration. More... | |
| std::shared_ptr< Sim > | m_sim |
| Simulator object. More... | |
Additional Inherited Members | |
Public Types inherited from stride::util::Subject< stride::sim_event::Id > | |
| using | EventType = stride::sim_event::Id |
| using | CallbackType = std::function< void(const EventType &)> |
The simulation runner drive simulator throufgh time steps.
It's functions are:
Definition at line 44 of file SimRunner.h.
|
explicit |
Initialization with property tree.
| configPt | config info for run and for config of simulator |
Definition at line 33 of file SimRunner.cpp.
References m_clock, stride::util::Subject< stride::sim_event::Id >::Notify(), and stride::util::Stopwatch< T >::Start().

|
overridedefault |
Destructor.
|
inline |
|
inline |
|
inline |
Return the Simulator.
Definition at line 61 of file SimRunner.h.

| void stride::SimRunner::Run | ( | ) |
Run simulator for as many steps/days as indicated in config.
Definition at line 76 of file SimRunner.cpp.
References m_config.
Referenced by GetSim().

| void stride::SimRunner::Run | ( | unsigned int | numSteps | ) |
Run simulator for numSteps steps/days.
Definition at line 41 of file SimRunner.cpp.
References m_clock, m_config, m_sim, stride::util::Subject< stride::sim_event::Id >::Notify(), stride::util::Stopwatch< T >::Start(), and stride::util::Stopwatch< T >::Stop().

|
private |
Stopwatch for timing the computation.
Definition at line 70 of file SimRunner.h.
Referenced by GetClock(), Run(), and SimRunner().
|
private |
Ptree with configuration.
Definition at line 71 of file SimRunner.h.
Referenced by GetConfig(), and Run().
|
private |