ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
Model.h
1/******************************************************************************
2* Copyright (c) ATTX LLC 2024. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, LLC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, LLC.
15******************************************************************************/
16/*
17Model header file - Includes declaration for model class which is the simulation base unit
18
19Author: Alex Reynolds
20*/
21#ifndef SIMULATION_MODEL_H
22#define SIMULATION_MODEL_H
23
24#include "architecture/Tasks.h"
25#include "simulation/SimulationExecutive.h"
27
28namespace modelspace {
29
30 /// @brief Base model class for derived implementation
31 ///
32 /// This is the base model class, which should be implemented in derived
33 /// models via class inheritence. It is designed around the "black box"
34 /// design of models, where each model is given startup parameters, inputs,
35 /// and outputs as defined:
36 ///
37 /// PARAMETERS: Configuration flags which should be carefully controlled
38 /// and only modified at few, select events (i.e. not every
39 /// timestep)
40 /// INPUTS: Input parameters to the model which may, but do not have
41 /// to, change often. These will often be connected to the
42 /// outputs of other models.
43 /// OUTPUTS: Output parameters from the model which are the result
44 /// of an internal calculation in the model.
45 ///
46 /// Functions are created in the base model class to be implemented in the
47 /// derived model. Each of the following may be left unmodified, in which case
48 /// they will do nothing. Functions should only be modified if the developer
49 /// wants them to do something. Once implemented, the functions will be called
50 /// automatically by the model and should not be invoked directly.
51 ///
52 /// Functionally, Model is no different than Task. However, Models are configured
53 /// for simulation specifically to work with the SimulationExecutive. This makes
54 /// a number of model features easier to use at the expense of making them non-
55 /// embedded C++.
56 class Model : public clockwerk::Task {
57 public:
58 /// @brief Default constructor for the task object for simplicity.
59 /// Note: Masks some functionality and should not be used for
60 /// production deployment.
61 Model();
62
63 /// @brief Task-based constructor for the task. Auto-assigns executive
64 /// @param pnt The task to assign as parent of this task
65 /// @param nme Name of the task
66 Model(Model &pnt, const std::string &m_name="Unnamed");
67
68 /// @brief Executive-based constructor for the task
69 /// @param executive The executive to set
70 /// @param m_name The name for the task
71 Model(SimulationExecutive &executive, const std::string &m_name="Unnamed");
72
73 /// @brief Task-based constructor for the task. Auto-assigns executive
74 /// @param pnt The task to assign as parent of this task
75 /// @param nme Name of the task
76 /// @param schedule_slot The slot to which the task should be scheduled.
77 /// Negative indicates it should not be scheduled.
78 /// Default is to schedule for ALL steps.
79 Model(Model &pnt, int schedule_slot, const std::string &m_name="Unnamed");
80
81 /// @brief Executive-based constructor for the task
82 /// @param executive The executive to set
83 /// @param m_name The name for the task
84 /// @param schedule_slot The slot to which the task should be scheduled.
85 /// Negative indicates it should not be scheduled.
86 /// Default is to schedule for ALL steps.
87 Model(SimulationExecutive &executive, int schedule_slot, const std::string &m_name="Unnamed");
88
89 /// @brief Desrtuctor. Doesn't really do anything
90 virtual ~Model() {};
91
92 protected:
93 /// Override our executive to include the SimulationExecutive instead.
94 /// Models will work with the SimulationExecutive per Alex decision 5/2024.
95 /// In all other respects they will be identical to tasks.
96 SimulationExecutive* exc = nullptr;
97 };
98
99}
100
101#endif
This is the base implementation of the task class.
Definition Tasks.h:68
Base model class for derived implementation.
Definition Model.h:56
Model(SimulationExecutive &executive, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Model.cpp:27
Model(Model &pnt, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Model.cpp:23
SimulationExecutive * exc
Override our executive to include the SimulationExecutive instead. Models will work with the Simulati...
Definition Model.h:96
Model(SimulationExecutive &executive, int schedule_slot, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Model.cpp:35
virtual ~Model()
Desrtuctor. Doesn't really do anything.
Definition Model.h:90
Model(Model &pnt, int schedule_slot, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Model.cpp:31
Model()
Default constructor for the task object for simplicity. Note: Masks some functionality and should not...
Definition Model.cpp:21
Implementation of the executive class for simulation.
Definition SimulationExecutive.h:63
Class to propagate CR3BP dynamics in characteristic units.
Definition ConfigurationWriter.cpp:18