Overview of system simulation (system simulation)
System simulation allows you to simulate a C, C++ or Java code application:
You can build an application using an animation ACS Code Generator DLL, and then simulate that application through the listener dll. The supplied listener dll is used to simulate all C, C++ or Java code applications.
Simulation tab
In Modeler, you use the Simulation tab to work with a simulation. The Simulation tab allows you to perform the following tasks:
• Start and stop the simulation (loads or unloads the listener dll).
• Suspend and resume the simulation (pauses the simulation).
• Set breakpoints in the simulation (C++ and Java code applications only).
• Enable and disable the animation of instance diagrams.
• Inject operations, events and time events.
• Set and read the values of attributes.
• Record notification logging to the Output pane and a log file.
• Clear the animation from instance diagrams.
• Close all instance diagrams.
Instance diagrams
When you run a simulation with animation enabled, Modeler animates temporary read-only copies of your State Diagrams - these diagrams are called instance diagrams.
When simulating a C, C++ or Java code system, Modeler can simulate multiple instances of a Class' State Diagram. The name of the first instance diagram is prefixed by '1 - ', the name of the second instance diagram is prefixed by '2 - ' and so on.
You can restrict which State Diagrams are animated by disabling the 'Enable Open Diagram Mode' button and then opening only those State Diagrams for which you want instance diagrams created.
Modeler uses color to animate the instance diagrams:
• The Transition and State which are active are shown in red.
• Transitions and States that are not active, but have been visited are shown in blue.
• Transitions and States that have not been visited are shown in black.
Through the Simulation tab, you can clear the animation from instance diagrams, and close all instance diagrams.
Interacting with the simulation
You can inject events and operations, and interrogate and set attribute values through the Simulation tab.
You open the Inject/Query dialog through the
Show Inject/Query Dialog button, and through this dialog inject events and operations, and interrogate and set attribute values. When injecting operation and events, or setting and reading attributes, the Inject/Query dialog works with the instance of the class that is associated with the instance diagram that is selected before opening the Inject/Query dialog.
For C++ and Java code applications only, you can add breakpoints to the simulation.
You can view the notification log in Modeler and save the notification log to a file.