21 #ifndef SIMULATION_SIMULATION_EXECUTIVE_H
22 #define SIMULATION_SIMULATION_EXECUTIVE_H
36 #include "SimPlatform.h"
39 class TimeTriggerMonitor;
40 class SimTerminationEvent;
77 int parseArgs(std::vector<std::string> arguments);
96 void end(
struct timespec end_time);
97 void end(
double end_time);
134 std::vector<std::string>
search(
const std::string &s_val);
148 std::vector<std::string>
searchSimTree(
const std::string &s_val);
Base app class for derived implementation.
Definition: App.h:55
Executive derivation specifically to run flight systems.
Definition: FlightExecutive.h:46
cfspp::Scheduler & _scheduler
System schedule, which determines what apps and functions run when.
Definition: FlightExecutive.h:142
bool isTerminated()
Get whether scheduler is terminated.
Definition: Scheduler.h:77
Holds the setup configuration for Flight Executive.
Definition: Setup.h:39
Wrapper to manage and convert time as timespce.
Definition: Time.h:53
Class to parse arguments from the command line in any language.
Definition: ArgParser.h:32
Class for logging to CSV.
Definition: CsvLogger.h:35
Class to generate input dispersions for the simulation.
Definition: DispersionEngine.h:76
Frame class definition.
Definition: Frame.h:96
Class to manage logs.
Definition: LogManager.h:41
Simple implementation of the scheduler class.
Definition: SimScheduler.h:48
modelspace::SimTimeManager time
Time manager to handle all time in the scheduler.
Definition: SimScheduler.h:116
int16 registerApp(cfspp::App &app, int16 slot) override
Function to register apps with the scheduler. Depending on the scheduler implementation these may be ...
Definition: SimScheduler.cpp:54
Inputs inputs
Definition: SimScheduler.h:67
Params params
Definition: SimScheduler.h:62
Class to manage time for the simulation object.
Definition: SimTimeManager.h:45
clockwerk::DataIO< clockwerk::Time > base_time
This is the exact current time as the scheduler steps forward.
Definition: SimTimeManager.h:116
void setTime(const std::string &time_input=DEFAULT_SIMULATION_TIME)
Function to set time by string input.
Definition: SimTimeManager.cpp:136
Implementation of the executive class for simulation.
Definition: SimulationExecutive.h:62
std::vector< std::string > searchFrameTree(const std::string &s_val)
Function to search the frame tree for a match.
Definition: SimulationExecutive.cpp:355
void runNumber(unsigned int run_num)
Setter for run number.
Definition: SimulationExecutive.h:176
~SimulationExecutive()
Definition: SimulationExecutive.cpp:75
void setTime(const std::string &time_in)
Function to set time by string input.
Definition: SimulationExecutive.h:204
bool isTerminated()
Get whether scheduler is terminated.
Definition: SimulationExecutive.h:211
int registerApp(cfspp::App &app, int16 slot)
Function to register apps with the scheduler. Depending on the scheduler implementation these may be ...
Definition: SimulationExecutive.h:222
SimScheduler _sim_scheduler
Definition: SimulationExecutive.h:256
SimulationExecutive()
Constructor for the simulation executive.
Definition: SimulationExecutive.cpp:35
int _rng_seed
Definition: SimulationExecutive.h:240
SimTerminationEvent * _term_event
Definition: SimulationExecutive.h:265
Linux _null_os
Definition: SimulationExecutive.h:284
bool visualsEnabled()
Indicator as to whether visuals are enabled.
Definition: SimulationExecutive.h:168
bool started()
Function to return whether the simulation executive is started.
Definition: SimulationExecutive.h:208
modelspace::SimScheduler & schedule()
Getter for the schedule.
Definition: SimulationExecutive.h:154
modelspace::SpiceManager & spiceManager()
Function to return pointer to the spice manager.
Definition: SimulationExecutive.h:196
void enableVisuals()
Function to enable visuals for the simulation.
Definition: SimulationExecutive.cpp:285
void _configureFromCmdLine()
Function to configure simulation executive from command line input.
Definition: SimulationExecutive.cpp:102
std::vector< std::string > search(const std::string &s_val)
Function to search the simulation and frame trees for a match.
Definition: SimulationExecutive.cpp:344
cfspp::Setup _null_setup
Definition: SimulationExecutive.h:286
TimeTriggerMonitor * _term_monitor
Monitor and event to terminate sim run.
Definition: SimulationExecutive.h:264
modelspace::VisualsModel & visualsModel()
Getter for the visuals model.
Definition: SimulationExecutive.h:157
int16 run()
Function to execute run for the executive and its kids /.
Definition: SimulationExecutive.cpp:249
int16 startup()
Function to initialize our simulation executive and everything it contains.
Definition: SimulationExecutive.cpp:298
clockwerk::Time end()
Function to return simulation end time.
Definition: SimulationExecutive.cpp:82
double simTime()
Function to access sim time.
Definition: SimulationExecutive.h:192
void disableVisuals()
Function to disable visuals for the simulation.
Definition: SimulationExecutive.cpp:294
void setRateHz(unsigned int rate_hz)
Function to set the simulation run rate, in Hz.
Definition: SimulationExecutive.cpp:132
LogManager _log_manager
Definition: SimulationExecutive.h:255
Frame & rootFrame()
Getter for the simulation root frame.
Definition: SimulationExecutive.h:126
void _printSimInfo()
Function to print information associated with the simulation.
Definition: SimulationExecutive.cpp:416
void integrator(int val)
Functions to set and get our integrator.
Definition: SimulationExecutive.h:80
void _configLogEverything(const std::string &filename)
Configure logger which will log all sim outputs.
Definition: SimulationExecutive.cpp:383
int parseArgs(int argc, char *argv[])
Wrapper around arg parse.
Definition: SimulationExecutive.cpp:86
modelspace::DispersionEngine & dispersions()
Function to access dispersions.
Definition: SimulationExecutive.h:184
int16 step()
Function to step the scheduler by a single step.
Definition: SimulationExecutive.cpp:177
Frame _root_frame
This is our sim's root frame, from which all other frames derive their relationships.
Definition: SimulationExecutive.h:251
modelspace::ArgParser & args()
Function to access args.
Definition: SimulationExecutive.h:180
DispersionEngine _dispersion_engine
To generate dispersions for the simulation.
Definition: SimulationExecutive.h:239
CsvLogger * _all_log
Definition: SimulationExecutive.h:280
SimulationExecutive & exc
Definition: SimulationExecutive.h:289
unsigned int _run_num
The run number.
Definition: SimulationExecutive.h:243
ArgParser _args
To parse our command line arguments.
Definition: SimulationExecutive.h:236
bool _started
Definition: SimulationExecutive.h:275
SimPlatform _null_platform
Definition: SimulationExecutive.h:285
VisualsModel * _visuals_model
Pointer to our visuals manager.
Definition: SimulationExecutive.h:268
int integrator()
Definition: SimulationExecutive.h:81
clockwerk::Time rate()
Function to acces the run rate of the simulation.
Definition: SimulationExecutive.h:123
modelspace::LogManager & logManager()
Getter for the log manager.
Definition: SimulationExecutive.h:151
void writeSimDataToJson(const std::string &filename)
Write all simulation data, including models, to json output.
Definition: SimulationExecutive.cpp:363
void setRateSec(clockwerk::Time rate_sec)
Function to set the simulation run rate, in seconds as Time.
Definition: SimulationExecutive.cpp:141
log_level_e _local_log_level
Our local log level – allows a higher log level locally than the overall system.
Definition: SimulationExecutive.h:271
std::vector< std::string > searchSimTree(const std::string &s_val)
Function to search the simulation architecture tree for a match.
Definition: SimulationExecutive.cpp:359
SpiceManager _spice_manager
The spice manager to control all spice interactions.
Definition: SimulationExecutive.h:259
modelspace::SimTimeManager & time()
Override of time() from executive to return SimTimeManager.
Definition: SimulationExecutive.h:188
unsigned long long _step_count
Variable to track the number of steps the simulation has taken.
Definition: SimulationExecutive.h:278
unsigned int runNumber()
Getter for run number.
Definition: SimulationExecutive.h:172
The Spice Manager is a single class instance to manage spice frames and return SPICE states.
Definition: spiceutils.h:49
Class for managing ModelSpace visuals.
Definition: VisualsModel.h:54
*Command to change the Log Level of any app
Definition: cmd_CommandManager.h:55
log_level_e
Log level enumerations.
Definition: flighterrors.h:89
@ LOG_INFO
Definition: flighterrors.h:93
Class to propagate CR3BP dynamics in characteristic units.
Definition: statistics.hpp:22
clockwerk::DataIO< int > integrator_type
The integrator type for the scheduler. Sets how models are integrated.
Definition: SimScheduler.h:53