Magic Model Analyst provides a simulation log, which is an element to record all event occurrences during simulation of a Simulation Configuration. It is a Class element applied with a «SimulationLog» stereotype. The «SimulationLog» stereotype comes with tag definitions as the options for selecting information that you want to record. 

Simulation log.

The tag definitions of the «SimulationLog» stereotype are as follows

  • recordedValues 
    To specify the property whose value will be recorded to the simulation log.
  • recordSignals 
    To specify whether the simulation log will record signals that are sent during simulation. If the value is true, all of the sent signals will be recorded. 
  • recordActivation 
    To specify whether the simulation log will record elements that are activated during simulation. If the value is true, all of the activated elements will be recorded.
  • recordCalls 
    To specify whether the simulation log will record Operations/Behaviors that are called during simulation. If the value is true, all of the called Operations/Behaviors will be recorded.
  • recordConstraintFailures 
    To specify whether the simulation log will record elements whose runtime values or objects fail the constraints applied on them. If the value is true, the elements that cause constraint failures will be recorded. 

You can create a new simulation log element and set it as a tagged value of the log tag definition of the Simulation Configuration as shown in the following figure

A Simulation Log as a Simulation Configuration Log

Simulation Config.
 

A model-based simulation log or trace has many benefits including

  • The source of various customized reports and analysis using the MagicDraw validation mechanism (as both are model-based).
  • The capability to import simulation data into any other UML compliant tools. 

You can record multiple simulation sessions or test results in the same «SimulationLog» element. The session's start time can be seen as an attribute's name. You can also record the following runtime data (see the following figure)

Signal Instance 
(when recordSignals = true) under the "Signal Instances" node: timestamp (that is the relative occurrence time in milliseconds: '0' when the simulation starts), signal type, and target (see the following figure).

Sequence of Activation and Sequence of Deactivation 
(when recordActivation = true) under the "Activation Sequence" node: timestamp and types of the element being activated or deactivated.

Behavior Call and Operation Call 
(when recordCalls = true) under the "Behavior Calls" and "Operation Calls" nodes respectively: timestamp, type, target, and value(s). 

Runtime Value 
(when the recordedValues attribute has at least one Property selected) under the "Value Changes" node: timestamp and the Property and value(s) of a selected Property.

Constraint Failure 
(when recordedConstraintFailures = true) under the "Constraint Failures" node: timestamp, element, target, and value(s). 

 

Recorded Runtime Information from the Stopwatch Sample

Recorded runtime information from the Stopwatch sample.