With Magic Model Analyst, you can use a Classifier with nested parts as the simulation context without the need to create Instance Specifications for those nested parts. Magic Model Analyst will create runtime objects for those parts automatically. If the type of a property is Data Type, the default value of the runtime value of that property will also be created, depending on the default value of the property's type. In addition, if the type of the part contains a specified Classifier Behavior, and the type itself is set as active, the Behavior will run (the autoStartActiveObjects option in the SimulationConfig must be set as true).
The first figure shows a Class diagram located in the FlashingLight.mdzip sample, demonstrating property light, button and timer as parts of the System Class.
Class System and its parts.
You may replace the SimulationTarget of the SimulationConfig named FlashLight with the System Class. You can see the result of running this SimulationConfig. The result shows that Runtime Objects are automatically created for the parts of the System Class, and the Behavior of each part also automatically starts.
Modified SimulationConfig FlashLight.
Sessions and Variables Panes showing runtime objects with a Classifier.
Related page