21#ifndef SIMULATION_SIMULATION_EXECUTIVE_H
22#define SIMULATION_SIMULATION_EXECUTIVE_H
36#include "SimPlatform.h"
41 class TimeTriggerMonitor;
42 class SimTerminationEvent;
79 int parseArgs(std::vector<std::string> arguments);
98 void end(
struct timespec end_time);
99 void end(
double end_time);
136 std::vector<std::string>
search(
const std::string &s_val);
150 std::vector<std::string>
searchSimTree(
const std::string &s_val);
240 {
_sim_setup.setWarpLinkInterface(ip, tlm_port, cmd_port);}
248 const std::string &ip,
int port)
256 const std::string shmem_address)
257 {
_sim_scheduler.connectExternalSharedMemory(signal, mode, shmem_address);}
Definition DataIOBase.h:63
Wrapper to manage and convert time as timespce.
Definition Time.h:53
Base app class for derived implementation.
Definition App.h:55
Executive derivation specifically to run flight systems.
Definition FlightExecutive.h:46
warpos::Scheduler & _scheduler
System schedule, which determines what apps and functions run when.
Definition FlightExecutive.h:144
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:49
Class to manage time for the simulation object.
Definition SimTimeManager.h:70
clockwerk::DataIO< clockwerk::Time > base_time
This is the exact current time as the scheduler steps forward.
Definition SimTimeManager.h:152
void setTime(const std::string &time_input=DEFAULT_SIMULATION_TIME)
Function to set time by string input.
Definition SimTimeManager.cpp:193
double simTime()
Function to access sim time.
Definition SimulationExecutive.h:194
int16 run()
Function to execute run for the executive and its kids /.
Definition SimulationExecutive.cpp:266
SimScheduler _sim_scheduler
Definition SimulationExecutive.h:290
void enableVisuals()
Function to enable visuals for the simulation.
Definition SimulationExecutive.cpp:302
void disableVisuals()
Function to disable visuals for the simulation.
Definition SimulationExecutive.cpp:315
warptwin::SpiceManager & spiceManager()
Function to return pointer to the spice manager.
Definition SimulationExecutive.h:198
void _configureFromCmdLine()
Function to configure simulation executive from command line input.
Definition SimulationExecutive.cpp:108
int _rng_seed
Definition SimulationExecutive.h:274
warptwin::LogManager & logManager()
Getter for the log manager.
Definition SimulationExecutive.h:153
TimeTriggerMonitor * _term_monitor
Monitor and event to terminate sim run.
Definition SimulationExecutive.h:298
std::vector< std::string > search(const std::string &s_val)
Function to search the simulation and frame trees for a match.
Definition SimulationExecutive.cpp:365
bool isTerminated()
Get whether scheduler is terminated.
Definition SimulationExecutive.h:213
bool _real_time_mode
Definition SimulationExecutive.h:306
warptwin::DispersionEngine & dispersions()
Function to access dispersions.
Definition SimulationExecutive.h:186
void integrator(int val)
Functions to set and get our integrator.
Definition SimulationExecutive.h:82
void setTime(const std::string &time_in)
Function to set time by string input.
Definition SimulationExecutive.h:206
SpiceManager _spice_manager
The spice manager to control all spice interactions.
Definition SimulationExecutive.h:293
SimSetup _sim_setup
Definition SimulationExecutive.h:324
int parseArgs(int argc, char *argv[])
Wrapper around arg parse.
Definition SimulationExecutive.cpp:92
LogManager _log_manager
Definition SimulationExecutive.h:289
unsigned int _run_num
The run number.
Definition SimulationExecutive.h:277
DispersionEngine _dispersion_engine
To generate dispersions for the simulation.
Definition SimulationExecutive.h:273
log_level_e _local_log_level
Our local log level – allows a higher log level locally than the overall system.
Definition SimulationExecutive.h:309
void terminate()
Function to terminate scheduler.
Definition SimulationExecutive.h:216
int integrator()
Definition SimulationExecutive.h:83
int scheduleTelemetry(int apid, clockwerk::Time rate)
Schedule telemetry in the sim.
Definition SimulationExecutive.cpp:404
~SimulationExecutive()
Definition SimulationExecutive.cpp:81
warptwin::SimScheduler & schedule()
Getter for the schedule.
Definition SimulationExecutive.h:156
bool _started
Definition SimulationExecutive.h:313
void connectExternalSocket(clockwerk::DataIOBase &signal, std::string mode, const std::string &ip, int port)
Connect a signal to an external socket.
Definition SimulationExecutive.h:247
std::vector< std::string > searchSimTree(const std::string &s_val)
Function to search the simulation architecture tree for a match.
Definition SimulationExecutive.cpp:380
Frame & rootFrame()
Getter for the simulation root frame.
Definition SimulationExecutive.h:128
SimulationExecutive & exc
Definition SimulationExecutive.h:327
void connectExternalSharedMemory(clockwerk::DataIOBase &signal, std::string mode, const std::string shmem_address)
Connect a signal to an external socket.
Definition SimulationExecutive.h:255
Frame _root_frame
This is our sim's root frame, from which all other frames derive their relationships.
Definition SimulationExecutive.h:285
warptwin::SimTimeManager & time()
Override of time() from executive to return SimTimeManager.
Definition SimulationExecutive.h:190
SimulationExecutive()
Constructor for the simulation executive.
Definition SimulationExecutive.cpp:35
bool started()
Function to return whether the simulation executive is started.
Definition SimulationExecutive.h:210
void setRateSec(clockwerk::Time rate_sec)
Function to set the simulation run rate, in seconds as Time.
Definition SimulationExecutive.cpp:158
void _printSimInfo()
Function to print information associated with the simulation.
Definition SimulationExecutive.cpp:455
void setWarpLinkInterface(std::string ip="127.0.0.1", uint32 tlm_port=5005, uint32 cmd_port=5006)
Set the IP address, telemetry port, and coommand port with WarpLink.
Definition SimulationExecutive.h:239
warptwin::ArgParser & args()
Function to access args.
Definition SimulationExecutive.h:182
int registerApp(warpos::App &app, int16 slot)
Function to register apps with the scheduler. Depending on the scheduler implementation these may be ...
Definition SimulationExecutive.h:227
SimLinux _sim_os
Definition SimulationExecutive.h:322
void _configLogEverything(const std::string &filename)
Configure logger which will log all sim outputs.
Definition SimulationExecutive.cpp:422
clockwerk::Time end()
Function to return simulation end time.
Definition SimulationExecutive.cpp:88
warptwin::VisualsModel & visualsModel()
Getter for the visuals model.
Definition SimulationExecutive.h:159
clockwerk::Time rate()
Function to acces the run rate of the simulation.
Definition SimulationExecutive.h:125
void runNumber(unsigned int run_num)
Setter for run number.
Definition SimulationExecutive.h:178
int16 startup()
Function to initialize our simulation executive and everything it contains.
Definition SimulationExecutive.cpp:319
SimTerminationEvent * _term_event
Definition SimulationExecutive.h:299
std::vector< std::string > searchFrameTree(const std::string &s_val)
Function to search the frame tree for a match.
Definition SimulationExecutive.cpp:376
SimPlatform _sim_platform
Definition SimulationExecutive.h:323
ArgParser _args
To parse our command line arguments.
Definition SimulationExecutive.h:270
unsigned long long _step_count
Variable to track the number of steps the simulation has taken.
Definition SimulationExecutive.h:316
int16 step()
Function to step the scheduler by a single step.
Definition SimulationExecutive.cpp:194
void writeSimDataToJson(const std::string &filename)
Write all simulation data, including models, to json output.
Definition SimulationExecutive.cpp:384
bool visualsEnabled()
Indicator as to whether visuals are enabled.
Definition SimulationExecutive.h:170
unsigned int runNumber()
Getter for run number.
Definition SimulationExecutive.h:174
CsvLogger * _all_log
Definition SimulationExecutive.h:318
void setRateHz(unsigned int rate_hz)
Function to set the simulation run rate, in Hz.
Definition SimulationExecutive.cpp:149
VisualsModel * _visuals_model
Pointer to our visuals manager.
Definition SimulationExecutive.h:302
The Spice Manager is a single class instance to manage spice frames and return SPICE states.
Definition spiceutils.h:49
Class for managing WarpTwin visuals.
Definition VisualsModel.h:55
log_level_e
Log level enumerations.
Definition flighterrors.h:159
@ LOG_INFO
Definition flighterrors.h:163
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22