Running a Simulation with Behavior Execution Engine
Overview
Once you have described both the structure and behavior of your system, you are ready to run a simulation! If you completed the previous sections, then you already modeled a simple system of a UAV, its power system, and its onboard computer. In this section, you will execute the state machine for your system and observe its operation.
This section covers the following concepts:
- How to use instance specifications to create simulations for Behavior Execution Engine.
- The simulation log file and diagnostics
Prerequisites
Prerequisite | Description |
---|---|
Behavior Execution Engine Installation | You must have installed Behavior Execution Engine. |
Tutorial Project |
You must start this section with the Behavior Execution Engine simulation project from the previous
section.
If you did not complete the previous section, you can use the following project from the Behavior Execution Engine installation:
\documentation\tutorialFiles\01\SimpleStateMachines.mdzip You could instead use a preexisting project that you configured for Behavior Execution Engine simulation, but the names of the elements in your project might not match the names in this section. |
Recommended Reading |
Before completing this section, you may want to read the following help topic:
|
Instructions
Set the instance specifications
When you run a simulation, Behavior Execution Engine collects all instance specifications referenced from the root instance to determine what classifier behaviors (such as state machines) to start.
- Open the project from the previous section.
- In the Containment Tree, double-click the Simulation > simulation instance specification to open its specification window. Select Slots from the left pane of the window.
- In the center pane, click on the subject property and create a value.
-
Select the Simulation >
uav.powerSystem
instance specification. Then click and then . This instructs Behavior Execution Engine to start theStructure::PowerSystem::PowerSystem State Machine
when the simulation begins, because thePowerSystem State Machine
is the classifier behavior for the classifier (thePowerSystem
block) of theuav.powerSystem
instance specification.
Run the simulation
- By default, the simulation will look for delegate modules in your DelegateModuleHomePath. This is located in your installation folder: (e.g., C:\BehaviorExecutionEngineInstall\delegates).
- If you previously installed any of the UAV mission delegates from the final tutorial or from the sample fully-completed tutorial included in the Behavior Execution Engine installation, then remove them from your delegate module home directory before running the simulation.
-
Alternately, you can use the
MoxieDelegateModulePaths
to specify where to find the delegates.
As it runs, the simulation will log messages to the simulation log file. These messages can be especially helpful for debugging simulations involving complex state machines and delegates that connect to external analysis tools.
- Before you continue, try Executing this simulation.
- Check the logs to verify the simulation completed successfully.
- Save your work before continuing.
Next Tutorial!