Manages and executes multiple models in a coordinated simulation. A Simulation aggregates Model instances and coordinates their execution, maintaining history records and providing access to simulation results.
#include <simulation.hpp>
|
|
| Simulation () |
| | Default constructor initializing with "console" logger.
|
| |
| | Simulation (const std::string &log_name) |
| | Constructs a Simulation with a specified logger.
|
| |
|
| ~Simulation ()=default |
| | Virtual destructor for polymorphic cleanup.
|
| |
|
void | Run () |
| | Executes one step of the simulation for all models. Calls RunTransitions() on each registered model in sequence.
|
| |
| void | AddModel (const std::unique_ptr< Model > &model) |
| | Adds a model to the simulation. The model is cloned and managed by the simulation.
|
| |
| const std::vector< std::unique_ptr< Model > > & | GetModels () const |
| | Retrieves all models in the simulation.
|
| |
| std::vector< std::string > | GetModelNames () const |
| | Retrieves the names of all models in the simulation.
|
| |
|
void | ClearModels () |
| | Removes all models from the simulation.
|
| |
| const std::vector< std::map< std::string, std::vector< Eigen::VectorXd > > > | GetModelHistories () const |
| | Retrieves the complete state histories for all models.
|
| |
| const std::vector< std::map< std::string, History > > | GetModelSparseHistories () const |
| | Retrieves sparse history objects for all models.
|
| |
| const std::vector< std::pair< std::string, std::string > > | GetModelHistoryNames () const |
| | Retrieves pairs of (model name, history name) for all histories.
|
| |
| std::string | GetLogName () const |
| | Retrieves the logger name used by this simulation.
|
| |
|
| Simulation (const Simulation &other) |
| | Copy constructor creating an independent deep copy of the simulation. All models are cloned; modifications to the copy do not affect the original.
|
| |
| Simulation & | operator= (const Simulation &other) |
| | Copy assignment operator for deep copying simulation state.
|
| |
◆ Simulation()
| respond::Simulation::Simulation |
( |
const std::string & |
log_name | ) |
|
|
inline |
- Parameters
-
| log_name | Name of the logger for this simulation (default: "console"). |
◆ AddModel()
| void respond::Simulation::AddModel |
( |
const std::unique_ptr< Model > & |
model | ) |
|
|
inline |
- Parameters
-
| model | A unique_ptr to a Model instance to add. |
◆ GetLogName()
| std::string respond::Simulation::GetLogName |
( |
| ) |
const |
|
inline |
- Returns
- The name of the associated logger.
◆ GetModelHistories()
| const std::vector< std::map< std::string, std::vector< Eigen::VectorXd > > > respond::Simulation::GetModelHistories |
( |
| ) |
const |
|
inline |
- Returns
- Vector of maps (one per model) mapping history names to state vector trajectories.
◆ GetModelHistoryNames()
| const std::vector< std::pair< std::string, std::string > > respond::Simulation::GetModelHistoryNames |
( |
| ) |
const |
|
inline |
- Returns
- Vector of pairs associating each history with its parent model.
◆ GetModelNames()
| std::vector< std::string > respond::Simulation::GetModelNames |
( |
| ) |
const |
|
inline |
- Returns
- Vector of model names in the order they were added.
◆ GetModels()
| const std::vector< std::unique_ptr< Model > > & respond::Simulation::GetModels |
( |
| ) |
const |
|
inline |
- Returns
- Const reference to the vector of Model unique_ptrs.
◆ GetModelSparseHistories()
| const std::vector< std::map< std::string, History > > respond::Simulation::GetModelSparseHistories |
( |
| ) |
const |
|
inline |
- Returns
- Vector of maps (one per model) mapping history names to sparse History objects.
◆ operator=()
- Parameters
-
| other | The simulation to copy from. |
- Returns
- Reference to this simulation after assignment.
The documentation for this class was generated from the following file: