|
| | Model (Model &pnt, int16 schedule_slot, const std::string &m_name="Unnamed") |
| | Task-based constructor for the task. Auto-assigns executive.
|
| | Model (SimulationExecutive &executive, int16 schedule_slot, const std::string &m_name="Unnamed") |
| | Executive-based constructor for the task.
|
| virtual | ~Model () |
| | Desrtuctor. Doesn't really do anything.
|
| std::vector< std::string > | listDefaultConfigs () |
| | List all default options for the model type.
|
| int | configureFromDefault (const std::string &default_name) |
| | Configure model from a default configuration.
|
| int | configureFromJson (const std::string &file_path) |
| | Configure model from a json file with keys as params of the model.
|
| int | configureFromJson (nlohmann::json j) |
| | Configure model from a json file with keys as params of the model.
|
| virtual nlohmann::json | asJson () |
| | Get model information as json.
|
| void | dump () |
| | Dump all information associated with the model.
|
| | App (FlightExecutive &executive, const char *name, uint16 apid, uint8 instance=0) |
| | Executive-based constructor for the task.
|
| virtual | ~App () |
| | Destructor. Doesn't really do anything.
|
| int16 | startup () |
| | Initialize the app. Should be called once before step.
|
| int16 | step () |
| | Step the app by a single step. Maps params, inputs, etc. to outputs.
|
| virtual int16 | activate () |
| | Activate the app. The app will step when active.
|
| virtual int16 | deactivate () |
| | Deactivate the app. The app will not step when deactivated.
|
| virtual int16 | command (uint16 apid, uint8 *buffer, uint16 size) |
| | Process commands issued to the app.
|
| log_level_e | logLevel () |
| | Get the log level set for the executive.
|
| void | logLevel (log_level_e log_level) |
| | Set the executive log level.
|
| bool | isStarted () |
| | Return whether task startup has been run.
|
| uint16 | apid () |
| | Get the apid for this app.
|
| uint8 & | instance () |
| | Get the instance of this app (used to differentiate between multiple instances of the same app).
|
| | GraphTreeObject (const char *gt_nme="", GraphTreeObject **storage_array=nullptr, uint32 storage_size=0) |
| | Name-based constructor for GraphTreeObject which will have no children by default.
|
| virtual | ~GraphTreeObject () |
| | Destructor.
|
| GraphTreeObject * | parent () |
| | Functions to get object's parent/children.
|
| GraphTreeObject ** | children () |
| GraphTreeObject * | childAtIndex (uint8 i) const |
| int16 | parent (GraphTreeObject *new_parent) |
| | Function to assign the node's parent via pointer.
|
| int16 | parent (GraphTreeObject &new_parent) |
| | Function to assign the node's parent via reference.
|
| uint8 | nChildren () const |
| | Getters for number of children and descendants.
|
| uint16 | nDescendants () const |
| uint8 | capacity () const |
| const char * | name () const |
| | Getter and setter for object name.
|
| int16 | name (const char *new_name) |
| uint8 | rank () |
| | Getter for the object rank.
|
| int8 | type () |
| | Function to indicate type – -1 by default unless implemented downstream.
|
| bool | loggable () |
| | Getter for object logability flag – note no setter because should only be set by this or a derived class in its definition.
|
| GraphTreeObject * | getRootDataPointer () |
| | Get the pointer to the highest object in the graph tree.
|
| virtual int16 | str (char *output, size_t size) const |
| | Get object represented as string.
|
| virtual int16 | fromStr (const char *val) |
| | Set value of graphtreeobject from string.
|
|
| virtual std::string | classType () |
| | Return the name of the class type.
|
| virtual int16 | start () |
| | Init the app. This is the specific call and should be overwritten in derived apps. Called from startup.
|
| virtual int16 | execute () |
| | Step the app. This is the specific call and should be overwritten in derived apps. Called from step.
|
| int16 | _setStorage (GraphTreeObject **storage_array, uint8 storage_size) |
| | Getter for object's string address.
|
| void | _recalculateDescendants () |
| | Function to recursively re-calculate the number of descendants of a given node on the tree.
|
| void | _recalculateRank () |
| | Function to recursively re-calculate the rank of a given node on the tree.
|
| int16 | _addChild (GraphTreeObject *child) |
| | Function to decompose a string into a series of substrings via indexing.
|
| int16 | _removeChild (GraphTreeObject *child) |
| | Function to remove a child from the graph node's children.
|
Base model class for derived implementation.
This is the base model class, which should be implemented in derived models via class inheritence. It is designed around the "black box" design of models, where each model is given startup parameters, inputs, and outputs as defined:
PARAMETERS: Configuration flags which should be carefully controlled and only modified at few, select events (i.e. not every timestep) INPUTS: Input parameters to the model which may, but do not have to, change often. These will often be connected to the outputs of other models. OUTPUTS: Output parameters from the model which are the result of an internal calculation in the model.
Functions are created in the base model class to be implemented in the derived model. Each of the following may be left unmodified, in which case they will do nothing. Functions should only be modified if the developer wants them to do something. Once implemented, the functions will be called automatically by the model and should not be invoked directly.
Functionally, Model is no different than Task. However, Models are configured for simulation specifically to work with the SimulationExecutive. This makes a number of model features easier to use at the expense of making them non- embedded C++.
- Note
- Models are allowed to have up to MAXIMUM_APP_CHILDREN children