Running Simulations Independently Outside Modeling Tools

Not all modeling tools allow the ability to create plugins that permit running interactive simulations. Running a Behavior Execution Engine simulation independently enables you to iterate on a design as you create and refine it. In particular, you can view the simulation and logs as it progresses, and even set breakpoints in the SysML model and the delegate code for debugging. Once you have a good simulation, you can run it automatically as part of a larger workflow or trade study.

SysML Client Application

The Behavior Execution Engine can run a simulation independently through the SysML Client Application. This Application exists in the install directory at application > SysML_Client > SysML_Client_Application.exe or within STK if it was optionally installed as a plugin.

Figure 1: The SysML Client Simulation Configuration

After selecting the install directory and loading a project, you will be taken to the Run Simulation screen. Here, you are required to specify a simulation configuration in order to run a simulation. Also, the tool offers a dialog to override the "slot" values of the SysML instances that will run inside the simulation. These are the values exposed from the SysML that can be used in can be set in the Configure Override Values window. If you are running with ModelCenter, these are the same override values that you will see from the ModelCenter Behavior Execution Engine Component Plugin.

After running a simulation, the output will be generated as a run in the output window. Open the report to view the inputs and outputs that were configured for that run.

Logging

You will find the log files and other output from running a simulation in the output directory specified when running your simulation. By default, this will be in the current user's AppData directory and will include sub-directories specific to distinguish between different runs. If your simulation terminates unexpectedly, look at the end of the log to find the exception that was thrown. Many times you will also find additional context that will aid you in identifying a solution to the problem.

The SysML Client also has a live log menu feature available during simulation runs by accessing it in the Actions menu.

State history

The simulation state history log file is a JSON representation of the most recent simulation run. It contains sequential entries for each state entered and exited and for each transition traversed. Each entry includes metadata about the state or transition, including the simulation time and the name and ID of the instance. The name of the log file is simulation_trace.json and you can find it adjacent to the simulation log file. This file is overwritten with each simulation run, so if you plan to compare simulation runs, be sure to save a copy of each run under a different name or in a separate directory after it completes.