2
3
4
5
6
7
8
9
10
11
12
13
14
15
17
18
19
20
21#ifndef SIMULATION_EXECUTIVE_H
22#define SIMULATION_EXECUTIVE_H
24#include "architecture/Executive.h"
25#include "six_dof_dynamics/Frame.hpp"
26#include "six_dof_dynamics/Body.hpp"
27#include "six_dof_dynamics/Node.hpp"
28#include "core/clockwerkerrors.h"
29#include "simulation/SimScheduler.h"
30#include "monitors/TimeTriggerMonitor.h"
31#include "events/SimTerminationEvent.h"
32#include "simulation/ArgParser.h"
33#include "simulation/DispersionEngine.h"
34#include "simulation/SimTimeManager.h"
35#include "logging/LogManager.h"
36#include "simulation/VisualsModel.h"
37#include "utils/spiceutils.h"
67 ~SimulationExecutive();
78 int parseArgs(std::vector<std::string> arguments);
91 void setRateSec(
struct timespec rate_sec);
92 void setRateSec(
double rate_sec);
96 void end(clockwerk::
Time end_time);
97 void end(
struct timespec end_time);
98 void end(
double end_time);
116 int step(
const clockwerk::
Time &step_size);
135 std::vector<std::string>
search(
const std::string &s_val);
149 std::vector<std::string>
searchSimTree(
const std::string &s_val);
const T & operator()()
Overloaded operator to return value of DataIO object.
Definition DataIO.hpp:129
int operator()(const T &new_value)
Function to set the value of the DataIO object.
Definition DataIO.hpp:115
Central control mechanism to run simulations and software.
Definition Executive.h:43
Frame class definition.
Definition Frame.hpp:92
Base class implementation of the monitor.
Definition Tasks.h:212
Class for logging data to a file.
Definition SimLogger.h:67
DataIO< Time > base_time
This is the exact current time as the scheduler steps forward.
Definition TimeManager.h:66
Wrapper to manage and convert time as timespce.
Definition Time.h:45
Class to parse arguments from the command line in any language.
Definition ArgParser.h:32
Class to generate input dispersions for the simulation.
Definition DispersionEngine.h:78
Class to manage logs.
Definition LogManager.h:42
void addLog(clockwerk::SimLogger &log, unsigned int rate)
Overloaded function to register and set up a logger.
Definition LogManager.cpp:62
void addLog(clockwerk::SimLogger &log, clockwerk::Monitor &monitor)
Overloaded function to register and set up a logger.
Definition LogManager.cpp:92
Simple implementation of the scheduler class.
Definition SimScheduler.h:47
virtual bool isTerminated()
Function to indicate whether the scheduler is terminated.
Definition SimScheduler.h:108
modelspace::SimTimeManager time
Time manager to handle all time in the scheduler.
Definition SimScheduler.h:115
Class to trigger termination in scheduler.
Definition SimTerminationEvent.h:35
Class to manage time for the simulation object.
Definition SimTimeManager.h:45
void setTime(const std::string &time_input=DEFAULT_SIMULATION_TIME)
Function to set time by string input.
Definition SimTimeManager.cpp:80
Implementation of the executive class for simulation.
Definition SimulationExecutive.h:63
std::vector< std::string > searchFrameTree(const std::string &s_val)
Function to search the frame tree for a match.
Definition SimulationExecutive.cpp:296
void runNumber(unsigned int run_num)
Setter for run number.
Definition SimulationExecutive.h:191
void setTime(const std::string &time_in)
Function to set time by string input.
Definition SimulationExecutive.h:219
bool isTerminated()
Returns termination flag.
Definition SimulationExecutive.h:183
int parseArgs(std::vector< std::string > arguments)
Wrapper around arg parse.
Definition SimulationExecutive.cpp:74
void addLog(clockwerk::SimLogger &log, unsigned int rate)
Overloaded function to register and set up a logger.
Definition SimulationExecutive.h:157
SimulationExecutive()
Constructor for the simulation executive.
Definition SimulationExecutive.cpp:25
modelspace::LogManager * logManager()
Getter for the log manager.
Definition SimulationExecutive.h:152
void addLog(clockwerk::SimLogger &log, clockwerk::Monitor &monitor)
Overloaded function to register and set up a logger.
Definition SimulationExecutive.h:162
void end(clockwerk::Time end_time)
Overloaded function to set the simulation end time.
Definition SimulationExecutive.cpp:128
bool started()
Function to return whether the simulation executive is started.
Definition SimulationExecutive.h:223
modelspace::SpiceManager * spiceManager()
Function to return pointer to the spice manager.
Definition SimulationExecutive.h:211
modelspace::VisualsModel * visualsModel()
Getter for the visuals model.
Definition SimulationExecutive.h:168
void enableVisuals()
Function to enable visuals for the simulation.
Definition SimulationExecutive.cpp:226
void _configureFromCmdLine()
Function to configure simulation executive from command line input.
Definition SimulationExecutive.cpp:82
std::vector< std::string > search(const std::string &s_val)
Function to search the simulation and frame trees for a match.
Definition SimulationExecutive.cpp:285
TimeTriggerMonitor _term_monitor
Monitor and event to terminate sim run.
Definition SimulationExecutive.h:263
int step(const clockwerk::Time &step_size)
Function to step the scheduler by a single step.
Definition SimulationExecutive.cpp:176
clockwerk::Time end()
Function to return simulation end time.
Definition SimulationExecutive.h:102
double simTime()
Function to access sim time.
Definition SimulationExecutive.h:207
clockwerk::Frame< double > * rootFrame()
Getter for the simulation root frame.
Definition SimulationExecutive.h:127
modelspace::DispersionEngine * dispersions()
Function to access dispersions.
Definition SimulationExecutive.h:199
clockwerk::log_level_e _local_log_level
Our local log level – allows a higher log level locally than the overall system.
Definition SimulationExecutive.h:270
void disableVisuals()
Function to disable visuals for the simulation.
Definition SimulationExecutive.cpp:235
void setRateHz(unsigned int rate_hz)
Function to set the simulation run rate, in Hz.
Definition SimulationExecutive.cpp:105
LogManager _log_manager
Specific declarations of scheduler, etc. specific to the simulation executive.
Definition SimulationExecutive.h:256
void _printSimInfo()
Function to print information associated with the simulation.
Definition SimulationExecutive.cpp:304
void integrator(int val)
Functions to set and get our integrator.
Definition SimulationExecutive.h:81
int parseArgs(int argc, char *argv[])
Wrapper around arg parse.
Definition SimulationExecutive.cpp:66
clockwerk::Executive * exc
Pointer to the executive object, which for sim executive is self This feature included for easy loggi...
Definition SimulationExecutive.h:234
int run()
/
Definition SimulationExecutive.cpp:201
int startup()
Function to initialize our simulation executive and everything it contains.
Definition SimulationExecutive.cpp:239
DispersionEngine _dispersion_engine
To generate dispersions for the simulation.
Definition SimulationExecutive.h:240
modelspace::SimTimeManager * time()
Override of time() from executive to return SimTimeManager.
Definition SimulationExecutive.h:203
int step()
Function to step the scheduler by a single step.
Definition SimulationExecutive.cpp:150
unsigned int _run_num
The run number.
Definition SimulationExecutive.h:244
ArgParser _args
To parse our command line arguments.
Definition SimulationExecutive.h:237
bool _started
Flag to indicate whether the executive has been properly started. Executive will not run unless start...
Definition SimulationExecutive.h:274
VisualsModel * _visuals_model
Pointer to our visuals manager.
Definition SimulationExecutive.h:267
modelspace::ArgParser * args()
Function to access args.
Definition SimulationExecutive.h:195
clockwerk::Time rate()
Function to acces the run rate of the simulation.
Definition SimulationExecutive.h:124
void setRateSec(clockwerk::Time rate_sec)
Function to set the simulation run rate, in seconds as Time.
Definition SimulationExecutive.cpp:114
std::vector< std::string > searchSimTree(const std::string &s_val)
Function to search the simulation architecture tree for a match.
Definition SimulationExecutive.cpp:300
SpiceManager _spice_manager
The spice manager to control all spice interactions.
Definition SimulationExecutive.h:260
unsigned long long _step_count
Variable to track the number of steps the simulation has taken.
Definition SimulationExecutive.h:277
unsigned int runNumber()
Getter for run number.
Definition SimulationExecutive.h:187
clockwerk::Frame< double > _root_frame
This is our sim's root frame, from which all other frames derive their relationships.
Definition SimulationExecutive.h:252
void logLevel(clockwerk::log_level_e new_level)
Function to set the local model log level.
Definition SimulationExecutive.h:179
modelspace::SimScheduler * schedule()
Getter for the schedule.
Definition SimulationExecutive.h:165
The Spice Manager is a single class instance to manage spice frames and return SPICE states.
Definition spiceutils.h:49
The time trigger monitor is a simple implementation of the monitor that triggers continuously after a...
Definition TimeTriggerMonitor.h:37
Class to write out frame information via socket using a standard interface as follows:
Definition VisualsModel.h:61
Class to propagate CR3BP dynamics in characteristic units.
Definition ConfigurationWriter.cpp:18
clockwerk::DataIO< int > integrator_type
The integrator type for the scheduler. Sets how models are integrated.
Definition SimScheduler.h:52
clockwerk::DataIO< clockwerk::Time > trigger_time
This is the variable indicating when the monitor should trigger.
Definition TimeTriggerMonitor.h:42