Cameo Simulation Toolkit 18.4 Documentation
- Created by Sanjeev Dasgupta, last modified on Aug 01, 2016
Cameo Simulation Toolkit is capable of initializing both context and runtime objects automatically even if a simulation context does not exist and no object is configured to initiate the runtime objects.
Context Initialization
When executing a behavior, Cameo Simulation Toolkit allows you to simulate its context as well.
How to simulate a behavior with its context
- Right-click a behavior or a behavior's diagram, and then select Simulation > Run with Context.

Figure 1: Executing a Behavior with Its Context
How to simulate a behavior without its context
- Right-click a behavior or a behavior's diagram, and then select Simulation > Run.
Figure 2: Executing a Behavior without Its Context
When you simulate a behavior with its context, Cameo Simulation Toolkit will initialize the context of the selected behavior and simulate the classifier behavior.
During the classifier behavior simulation, if the runtime object of the context classifier is stable, the selected behavior will be simulated.
If a selected behavior has no context, the Run with Context menu will be disabled (see the following figure).

Figure 3: Simulation shortcut menu
Runtime Object Initialization
When you use an InstanceSpecification to initialize a run-time object, you will also need to use the corresponding slot values of such InstanceSpecification to initialize the feature values of the run-time object. Cameo Simulation Toolkit will use the default value of the corresponding feature (property) of each slot if the slot value is empty.
The value of each feature (property) will be automatically initialized only if its Lower-value Multiplicity is more than zero or is undefined. Otherwise (the feature's Lower-value Multiplicity is zero), the feature value will be empty (nothing is initialized).
However, characteristic of the initialization depends on the type of the feature. The following sections explain the types of feature that can influence initialization characteristics.
a) Structural Feature Typed by Primitive Datatype
The default value of a structural feature, which is typed by a primitive datatype, is its initialized value.This default initialization value, which can be set from Options > Environment >Simulation as shown in following figure. When true and value property has no default value, the value will be initialized to 0 value.
Default is false.
The data types which are affected by this option are listed in the table below.

Figure 4: Simulation Environment Options - Initialize Empty Values to 0
This initialization value applies to numerical data types only. For other types, see the table below.
Table listing of Value Used for Automatic Initialization of the Structural Feature typed by Primitive Datatype
Primitive DataType (QualifiedName) | Value |
---|---|
• UML Standard Profile::UML2 Metamodel::PrimitiveTypes::Boolean • PrimitiveValueTypes::Boolean (SysML Profile.mdzip) • UML Standard Profile::MagicDraw Profile::datatypes::boolean | false |
• UML Standard Profile::UML2 Metamodel::PrimitiveTypes::Integer • UML Standard Profile::UML2 Metamodel::PrimitiveTypes::UnlimitedNatural • PrimitiveValueTypes::Integer (SysML Profile.mdzip) • PrimitiveValueTypes::UnlimitedNatural (SysML Profile.mdzip) • UML Standard Profile::MagicDraw Profile::datatypes::int • UML Standard Profile::MagicDraw Profile::datatypes::long • UML Standard Profile::MagicDraw Profile::datatypes::short | All numerical data types pick up their default initialization value from Environment options as shown in above figure. |
• UML Standard Profile::UML2 Metamodel::PrimitiveTypes::Real • PrimitiveValueTypes::Real (SysML Profile.mdzip) • UML Standard Profile::MagicDraw Profile::datatypes::double • UML Standard Profile::MagicDraw Profile::datatypes::float | All numerical data types picks up their default initialization value from Environment options as shown in above figure. |
• Enumeration | • UML Standard Profile::UML2 Metamodel::PrimitiveTypes::Real |
• UML Standard Profile::UML2 Metamodel::PrimitiveTypes::String • PrimitiveValueTypes::String (SysML Profile.mdzip) | "" (Empty String) |
b)Structural Feature TypedbyNon-Datatype
If the type of a structural feature is not a datatype:
- If the structural feature has a non-empty slot value, it will be initialized with such value.
- Otherwise, if the structural feature's default value is specified, it will be initialized with the default value.
If the structural feature also has internal feature(s), for each internal feature:
- If the internal feature has a non-empty slot value, it will be initialized with such value.
- Otherwise, if the internal feature's default value is specified, it will be initialized with the default value.
If an internal feature also has its own internal feature(s), the same rule above will be applied, recursively.
c) Structural Feature TypedbyUser-defined Datatype
For a structural feature typed by a user-defined datatype:
- If the Datatype has internal structural feature(s), the value of the structural feature will be initialized as described in "b) Structural Feature Typed by Non-Datatype".
- If the Datatype has no internal structural feature:
- The value of the structural feature will be initialized as described in "a) Structural Feature Typed by Primitive Datatype" if the Datatype is inherited from a primitive datatype.
- The initialized value of the structural feature will be its default value if the Datatype is not inherited from any primitive datatype. If the default value of the feature is, however, not specified, the initialized value will be empty.
- No labels