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:

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.

  1. Open the project from the previous section.
  2. 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.
  3. In the center pane, click on the subject property and create a value.
  4. Select the Simulation > uav.powerSystem instance specification. Then click OK and then Close. This instructs Behavior Execution Engine to start the Structure::PowerSystem::PowerSystem State Machine when the simulation begins, because the PowerSystem State Machine is the classifier behavior for the classifier (the PowerSystem block) of the uav.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.

There are several ways to run a Behavior Execution Engine simulation, depending on which other software you are using. To review options and reference how to execute your simulations from your respective environment, see the section on Running Simulations. For these tutorials, we will ask you to use these methods to "Execute the simulation" through one of these methods.
  1. Before you continue, try Executing this simulation.
  2. Check the logs to verify the simulation completed successfully.
  3. Save your work before continuing.

Next Tutorial!