Routines
Routines are the building blocks of your ConOps, allowing for comprehensive and customizable modeling of flight software and other behavior of agents in Sedaro. Routines are used to construct programs, which are logically independent structures stemming from a single main routine. The main routine is always active and, based on its type, may select an active subroutine out of its subroutines. The active subroutine may also select from its subroutines, as can its subroutines, etc. until an active subroutine does not select an active subroutine. The state of the program is equivalent to the sequence of active routines, beginning from the main routine; various Modes on the Agent (such as PointingMode and DataMode) can become active or inactive based on the state of the program. Multiple programs can be created, allowing for the simulation of independent and loosely-coupled subsystems.
The definition of the Routine specifies the logic that is used to select the active subroutine. There four classes of Routine are summarized as follows:
- Routine: the generic Routine block can have no subroutines
- CombinationalLogic: Each subroutine is assigned a priority, constraints, and a set of Conditions. The compliant subroutine with the highest priority is selected to be active, and optionally a default subroutine will become active if none are compliant. This is equivalent to the logic governing the deprecated OperationalModes, except that any subroutine can be set as the default (or there can be no default).
- FiniteStateMachine: Each subroutine is a state of a finite state machine. Define the transitions between states based on conditions and priority.
- Schedule: Subroutines are scheduled, either using UTC or elapsed simulation time.
All existing Routines are visible in graph form in the routines widget. To create a new Routine, click the "Add Routines" button and drag a Routine of the desired type into the graph. Edit routines by double clicking on the nodes and clicking the edit button on edges of the graph. Routines can also be added by creating new edges between nodes.
Combinational Logic
Each subroutine of a CombinationalLogic is assigned a LogicalConfiguration block, which is defined by the priority of the subroutine, constraints, and a set of Conditions. In the UI a new subroutine is added and pairing LogicalConfiguration created by creating a new edge between the CombinationalLogic and its subroutine. Double click on the CombinationalLogic to edit the priority of the subroutines and set the default subroutine.
Finite State Machine
Except for the deletion of edges (which will delete the subroutine from the FSM including transitions to and from that state), a FiniteStateMachine (FSM) can only be edited by double clicking on it. This opens a dedicated graph for defining the transitions between machine states, represented by the subroutines. Click and drag from one subroutine to another to define a StateTransition. Click the edit button on the StateTransition edge to specify the conditions and priority with which the transition will occur. The transition is compliant if all of its conditions are compliant. Multiple transitions can be create between the same states, and these will lie on top of each other in the diagram. When you click the edit button, you may have to choose between some overlapping transitions.
A FSM does not have a default subroutine since it can only choose a new subroutine with an allowed transition. In fact, FSM requires an additional selection of an initial subroutine in order to set the initial state. When the FSM becomes inactive in the simulation, it will resume in the previously active state when re-activated.
Schedule
When creating a schedule, choose between a FixedSchedule (uses UTC) and RelativeSchedule (uses elapsed sim time). Add subroutines to the schedule by creating an edge from the Schedule node, and double click the Schedule node to define the times at which a subroutine is active. You can also use the form to define the default subroutine.