Running Simulations

Moxie projects typically contain several elements that pertain to the simulation rather than the model, but only a few of these elements are required. See the simulation checklist for a quick reference of everything a simulation needs, see the first tutorial to learn how to create a Moxie simulation project, or see the following topics for a more detailed discussion of simulation-related elements:

Simulation checklist

A Moxie simulation has certain required elements and some additional options. To help ensure success, you can use the Moxie Simulation Project template, which already includes most of the requirements, or you can create your own project template.

A Moxie simulation must include the following:

  • A complete Moxie installation
  • A No Magic modeling tool project
  • A project reference to the Moxie model libraries
  • At least one block with the following properties/values:
    • Base Classifier = Moxie-Base::Structure::Thing or any element having the top-level base classifier Moxie-Base::Structure::Thing
    • Classifier Behavior = {Behavior}, which is a state machine you want to simulate
  • At least one instance specification for a block that owns a classifier behavior
  • A simulation instance specification with the following properties/values:
    • Classifier = Moxie-Base::Simulation::SimulationSpecification
    • Slots = roots = [InstanceSpecification1, InstanceSpecification2, ...] - At least one instance specification must be listed in the roots slot. Instance specifications you specify here must have classifiers that each own a classifier behavior.
  • A simulation configuration with the following properties/values:
    • Execution Target = {SimulationInstanceSpecification} - This is the simulation instance specification listed above.
    • Engines Priority = [Moxie Engine, ...] - The Moxie Engine must be specified in the first position.
    • (Optional) Silent = false - This tells Moxie to show behavior diagram animation during the simulation.

The following diagrams are optional but recommended:

Diagram Description
Block definition diagram Useful for viewing blocks and the relationships between them
Simulation configuration diagram Provides a user-friendly view of the simulation configuration
Instance specification diagram Useful for viewing all the Instance Specifications used in the simulation, the relationships among them, and their initial property values
Simulation dashboard Useful for monitoring the execution of behaviors in real time during a simulation

Troubleshooting

If your simulation fails, you should begin your investigation by looking at the simulation console and log file. In addition, run the model validation report to ensure the validity of the syntax in your state machines. Refer to the Troubleshooting page for additional information, including a list of known error messages and solutions to common problems.