On this page

You can run a Class element that is not a Behavior. Magic Model Analyst will initialize an object from the selected Class. The default value of its parts and properties will be used for initialization. If the selected Class has a defined Classifier Behavior which is Activity, State Machine or Interaction, it will also be simulated. For example, if you execute the Calculator.mdzip Class, the simulation will be performed on the Calculator State Machine as shown in the figure Animation of a State Machine Simulation in the State Machine section. 

State Machine as the Classifier Behavior of the Calculator Class

State Machine as the Classifier Behavior of the Calculator Class.

If the Class does not have a Classifier Behavior, Magic Model Analyst will initialize the object from the selected Class and show its values and parts in the Variables pane. For a SysML model, Magic Model Analyst will update the values within the object with the constraint properties and the binding connectors. Therefore, you can manipulate the values of the object when working with the parametric model of the Class.                                   

Running a SysML Block that Has No Defined Classifier Behavior

Running a SysML block that has no defined Classifier Behavior.
Animation of a SysML Parametric Diagram
Animation of a SysML Parametric diagram.

You can simulate a system even though there is no Classifier Behavior in either the parent or its subsystems. When Magic Model Analyst runs the system, all Classifiers that have or do not have Classifier Behaviors will be simulated. The simulation will run the system and will stop only if you terminate it by clicking the Stop button.

Initialization of value properties using Arrays of default values

Magic Model Analyst supports use of Arrays in Class/Block as a data type. A primitive value type, e.g., String, Boolean, Integer, and Real, as a value property with a default value using an Array can be initialized. The value property is shown in tree control structure on the Variables pane as shown in the figure below.


Primitive value types are initialized as value properties with default values using Arrays.

Furthermore, the value property name as a variable can be used as a member of an Array. For example, x = 5 and v = [2, 3, 4, x] make the initialized v = [2, 3, 4, 5].

Note

  • The initialization through an instance replaces the default value in the Array of the Block.
  • Any missing values in Array slots are replaced by default values from the Array of the Block.

Automatic instantiation of the implementation Class

Simulation Toolkit supports automatic instantiation of an implementation Class, if the super Class is abstract (Is Abstract = true).

Note

If there are multiple implementation Classes, Simulation Toolkit will randomly choose one.

Automatic instantiation of the implementation Class if the super Class is abstract.