|
Icarus
Vehicle Simulation as a Transformable Computational Graph, built on Vulcan and Janus
|
Top-level simulation coordinator. More...
#include <Simulator.hpp>
Public Types | |
| using | InputSourceCallback = std::function<double(const std::string &)> |
| Input source callback: (signal_name) -> value. | |
| using | OutputObserverCallback = std::function<void(const std::string &, double)> |
| Output observer callback: (signal_name, value) -> void. | |
Public Member Functions | |
| Simulator () | |
| Default constructor for programmatic setup. | |
| ~Simulator () | |
| Destructor. | |
| Simulator (const Simulator &)=delete | |
| Simulator & | operator= (const Simulator &)=delete |
| Simulator (Simulator &&)=delete | |
| Simulator & | operator= (Simulator &&)=delete |
| void | Stage () |
| Stage the simulation. | |
| void | Stage (const StageConfig &config) |
| void | Step (double dt) |
| Execute one simulation step. | |
| void | Step () |
| const std::string & | Name () const |
| Get simulation name (from config). | |
| double | Dt () const |
| Get configured timestep. | |
| double | EndTime () const |
| Get configured end time. | |
| double | Time () const |
| Get current simulation time (MET - derived from epoch). | |
| const vulcan::time::NumericEpoch & | Epoch () const |
| Get current epoch (single source of truth for time). | |
| double | JD_UTC () const |
| Get Julian Date in UTC scale. | |
| double | JD_TAI () const |
| Get Julian Date in TAI scale. | |
| double | JD_TT () const |
| Get Julian Date in TT scale. | |
| double | JD_GPS () const |
| Get Julian Date in GPS scale. | |
| int | GPSWeek () const |
| Get GPS week number. | |
| double | GPSSecondsOfWeek () const |
| Get GPS seconds of week. | |
| std::string | ISO8601 () const |
| Get current time as ISO 8601 string. | |
| Lifecycle | GetLifecycle () const |
| Get current simulation lifecycle state. | |
| int32_t | GetFlightPhase () const |
| Get current flight phase value (from PhaseManager). | |
| std::string | GetFlightPhaseName () const |
| Get current flight phase name (from PhaseManager). | |
| bool | IsInitialized () const |
| Check if simulation is initialized (Staged or later). | |
| double | Peek (const std::string &name) const |
| Read a signal value by name. | |
| DataDictionary | GetDataDictionary () const |
| Get data dictionary for the simulation. | |
| IntrospectionGraph | GetIntrospectionGraph () const |
| Get introspection graph (data dictionary + topology edges). | |
| const SignalRegistry< double > & | Registry () const |
| Get signal registry (for recording, introspection). | |
| void | Poke (const std::string &name, double value) |
| Write a signal value by name. | |
| MissionLogger & | GetLogger () |
| Get the mission logger. | |
| const MissionLogger & | GetLogger () const |
| void | Reset () |
| Reset simulation to initial state Re-applies ICs, resets time to 0. | |
| void | SetTime (double met) |
| Set simulation time (MET). | |
| void | SetInputSource (const std::string &signal_name, InputSourceCallback callback) |
| Register an external input source for a signal. | |
| void | SetOutputObserver (const std::string &signal_name, OutputObserverCallback callback) |
| Register an output observer for a signal. | |
| void | ClearInputSource (const std::string &signal_name) |
| Remove an input source. | |
| void | ClearOutputObserver (const std::string &signal_name) |
| Remove an output observer. | |
| Eigen::VectorXd | GetState () const |
| Get current state vector. | |
| void | SetState (const Eigen::VectorXd &X) |
| Set state vector. | |
| Eigen::VectorXd | ComputeDerivatives (double t) |
| Compute derivatives for current state at time t. | |
| AdaptiveStepResult< double > | AdaptiveStep (double dt_request) |
| Execute adaptive step (requires RK45 integrator). | |
| std::optional< janus::Function > | GetDynamicsGraph () const |
| Get symbolic dynamics graph Available after Stage() if symbolics.enabled = true. | |
| std::optional< janus::Function > | GetJacobian () const |
| Get symbolic Jacobian Available after Stage() if symbolics.generate_jacobian = true. | |
| const std::optional< staging::TrimResult > & | GetTrimResult () const |
| Get trim result Available after Stage() if trim.enabled = true. | |
| const std::optional< staging::LinearModel > & | GetLinearModel () const |
| Get linear model Available after Stage() if linearization.enabled = true. | |
| const SimulatorConfig & | GetConfig () const |
| Get simulator configuration. | |
| void | AddComponent (std::unique_ptr< Component< double > > component) |
| Add a component to the simulation. | |
| void | AddComponent (const ComponentConfig &config) |
| Add a component from config (requires ComponentFactory). | |
| void | Configure (const SimulatorConfig &config) |
| Configure simulator with full config struct. | |
| void | AddRoutes (const std::vector< signal::SignalRoute > &routes) |
| Add signal routes. | |
| std::size_t | NumComponents () const |
| Get number of components. | |
| Backplane< double > & | GetBackplane () |
| Get backplane for signal introspection (expert). | |
| const Backplane< double > & | GetBackplane () const |
Static Public Member Functions | |
| static std::unique_ptr< Simulator > | FromConfig (const std::string &config_path) |
| Create simulator from configuration file. | |
| static std::unique_ptr< Simulator > | FromConfig (const SimulatorConfig &config) |
| Create simulator from configuration struct. | |
Top-level simulation coordinator.
NOT templated on Scalar - user sees one class. Provides clean 4-operation external interface:
| using icarus::Simulator::InputSourceCallback = std::function<double(const std::string &)> |
Input source callback: (signal_name) -> value.
| using icarus::Simulator::OutputObserverCallback = std::function<void(const std::string &, double)> |
Output observer callback: (signal_name, value) -> void.
|
inline |
Default constructor for programmatic setup.
|
inline |
Destructor.
|
delete |
|
delete |
|
inline |
Execute adaptive step (requires RK45 integrator).
|
inline |
Add a component from config (requires ComponentFactory).
|
inline |
Add a component to the simulation.
|
inline |
Add signal routes.
|
inline |
Remove an input source.
|
inline |
Remove an output observer.
|
inline |
Compute derivatives for current state at time t.
|
inline |
Configure simulator with full config struct.
|
inlinenodiscard |
Get configured timestep.
|
inlinenodiscard |
Get configured end time.
|
inlinenodiscard |
Get current epoch (single source of truth for time).
|
inlinestaticnodiscard |
Create simulator from configuration struct.
|
inlinestaticnodiscard |
|
inlinenodiscard |
Get backplane for signal introspection (expert).
|
inlinenodiscard |
|
inlinenodiscard |
Get simulator configuration.
|
inlinenodiscard |
Get data dictionary for the simulation.
|
inlinenodiscard |
Get symbolic dynamics graph Available after Stage() if symbolics.enabled = true.
|
inlinenodiscard |
Get current flight phase value (from PhaseManager).
|
inlinenodiscard |
Get current flight phase name (from PhaseManager).
|
inlinenodiscard |
Get introspection graph (data dictionary + topology edges).
|
inlinenodiscard |
Get symbolic Jacobian Available after Stage() if symbolics.generate_jacobian = true.
|
inlinenodiscard |
Get current simulation lifecycle state.
|
inlinenodiscard |
Get linear model Available after Stage() if linearization.enabled = true.
|
inlinenodiscard |
Get the mission logger.
|
inlinenodiscard |
|
inlinenodiscard |
Get current state vector.
|
inlinenodiscard |
Get trim result Available after Stage() if trim.enabled = true.
|
inlinenodiscard |
Get GPS seconds of week.
|
inlinenodiscard |
Get GPS week number.
|
inlinenodiscard |
Check if simulation is initialized (Staged or later).
|
inlinenodiscard |
Get current time as ISO 8601 string.
|
inlinenodiscard |
Get Julian Date in GPS scale.
|
inlinenodiscard |
Get Julian Date in TAI scale.
|
inlinenodiscard |
Get Julian Date in TT scale.
|
inlinenodiscard |
Get Julian Date in UTC scale.
|
inlinenodiscard |
Get simulation name (from config).
|
inlinenodiscard |
Get number of components.
|
inlinenodiscard |
Read a signal value by name.
| name | Full signal path: "Entity.Component.signal" |
Read a scalar signal value by name
|
inline |
Write a signal value by name.
Write a scalar signal value by name
|
inlinenodiscard |
Get signal registry (for recording, introspection).
|
inline |
Reset simulation to initial state Re-applies ICs, resets time to 0.
|
inline |
Register an external input source for a signal.
|
inline |
Register an output observer for a signal.
|
inline |
Set state vector.
|
inline |
Set simulation time (MET).
Used by warmstart to restore time from recording. Sets epoch_ = epoch_start_ + met.
| met | Mission Elapsed Time to set |
|
inline |
Stage the simulation.
Prepares the vehicle for launch:
|
inline |
|
inline |
|
inline |
Execute one simulation step.
Uses scheduler for multi-rate execution. Advances time by dt using configured integrator.
| dt | Timestep (uses nominal dt if not specified) |
|
inlinenodiscard |
Get current simulation time (MET - derived from epoch).