Presentation is loading. Please wait.

Presentation is loading. Please wait.

Topcased 5.3 Simulation of models Tutorial 2012-12-12 Topcased Simulation - Tutorial Page 1.

Similar presentations


Presentation on theme: "Topcased 5.3 Simulation of models Tutorial 2012-12-12 Topcased Simulation - Tutorial Page 1."— Presentation transcript:

1 Topcased 5.3 Simulation of models Tutorial 2012-12-12 Topcased Simulation - Tutorial Page 1

2 Introduction  Mechanisms of simulation of models  ‘Early model’ approach  What is new in version 5.3 How to use  Starting the simulation  Used views in platform  Stimulating the running system  Controlling execution flow  Getting details on running system UML Supported features  Classification and structures  State machines  Activities  OCL interpretation More information… Agenda Topcased Simulation - Tutorial Page 2 2012-12-12

3 Mechanisms of simulation of models  Topcased provides an component capable of interpreting UML models.  Possibility to animate State machines and activities of a model.  Visualisation of current states and enabled actions.  Just like a UML « Virtual Machine ».  Possibility to send and receive message from a system.  From a step-to-step interpretation to a continuous execution. ‘Early model’ approach  Unlike traditional programming, model does not need to be fully semantically correct to be interpreted.  Only used Classes and Activities are required to be conform to Model language  If an action or an expression is inconsistent, a error is displayed in console but, most of the time, simulation can proceed. Introduction Topcased Simulation - Tutorial Page 3 2012-12-12

4 What is new in version 5.3  Model simulation has been completely redesign for Topcased 5.3  Control of interpretation flow has been updated -Provided buttons is now based on “debug” feature -It is possible to “see” emitted message.  Syntax of displayed elements is inspired from common syntax: -State of object interpretation use folder convention -Property of object used dotted notation  UML coverage is wider, especially for State Machine concern.  OCL is applicable for all opaque elements.  Models of Topcased 5.2 require update to run under Topcased 5.3 -Signal Event requires signal property (as defined in UML). -To send a signal to an instance, its classifier must declare a “reception” of the signal. Introduction Topcased Simulation - Tutorial Page 4 2012-12-12

5 Topcased Simulation - Tutorial Page 5 How to use Starting the simulation  Select a file containing a UML model or Papyrus file.  Right click and select “Simulate”.  A dialog box appears to define session context.

6 2012-12-12 Topcased Simulation - Tutorial Page 6 How to use Starting the simulation  In start dialog first page, -Select an execution mode Only default mode available. (Traces file and mode is for future versions) -Select the display mode “Papyrus Animator” for Papyrus models.  In second page, -Define properties about time value of the date when simulation begins. Ratio between real time and simulation time for continuous execution. -Select the main objet to simulate This objet is the root of the executed system.

7 Used views in platform How to use Topcased Simulation - Tutorial Page 7 2012-12-12

8 Used views in platform  ‘Model Simulation’ view is specific to simulation -Provides buttons to pause, resume execution or select step order.  ‘Console’ view: -Display signal emitted from simulation -Show warning about model inconsistencies  Customized Papyrus Editor -Diagrams are duplicated for each executed behaviour -Current state is coloured in those diagrams.  Enriched ‘Model Explorer’ view -Contain the state and properties values of all instances in the running environment -Closed diagrams can be opened again How to use Topcased Simulation - Tutorial Page 8 2012-12-12

9 Stimulating the running system  Click on the ‘Send Signal’ button from ‘Model Simulation’ view  Select a destination for the signal > increases the current date of the system; The default value is duration until the next timer end.  Select the signal to send Signal list is defined from the interfaces and ports implemented by the class of selected instance. For the signal to appear in the provided list, a “reception” of the signal must be declared as feature of the classifier of the selected instance.  Fill the signal content For 5.3 version, only UML primitive types are supported. How to use Topcased Simulation - Tutorial Page 9 2012-12-12

10 Controlling execution flow  ‘Model Simulation’ view provides several actions to control the order of actions Provided buttons are based on ‘Debug’ approach. Same semantic is applied.  ‘Resume’ interprets all available actions and event consumptions. When no more actions is available, system date is updated accordingly with pending time events. To provide an experience closed to real execution, interpretation is paused for a while according next event date and time ratio of simulation properties.  ‘Suspend’ stops continuous interpretation and step sequences.  ‘Terminate’ ends simulation session.  ‘Reload’ restarts the simulation from the beginning. How to use Topcased Simulation - Tutorial Page 10 2012-12-12

11 Controlling execution flow  Steps buttons provide controls on interpretation sequence A dialog proposes available actions. List of actions is established based on UML semantic. Syntax for action: “Instance Name” / “Activity Name” / “Action Name” Syntax for event: “Instance Name” / > “Event content”  When no step is available, increasing system date is proposed. How to use Topcased Simulation - Tutorial Page 11 2012-12-12

12 Controlling execution flow  Step Into : Execute a 1 single step On a call of activity, initialise the activity and pause On a transition with activities, enter the first activity and pause  Step Over : Execute 1 action On a call of activity, execute it until the ends. On a transition with activities, execute the whole transition.  Step Return : Complete parent activity On an action, execute all actions of parent activity and pause. Otherwise behave like Step Over. How to use Topcased Simulation - Tutorial Page 12 2012-12-12

13 Getting details on running system  Via diagram animation For Papyrus model, an editor is opened and each behaviour of running instances is shown using corresponding diagram. In State Machine, current states or transition are green bold. In Activity, enabled actions are red bold, flow tokens are green bold. How to use Topcased Simulation - Tutorial Page 13 2012-12-12

14 Getting details on running system  Via ‘Model Explorer’ view In Additional resources, simulation state is available. In ‘state’ and ‘activityExecution’ nodes, is it possible to re-open closed diagrams. All simulation states are available: Event queues, Activity tokens, deferred events, …  Objects tree is editable: Change instance attributes using ‘Properties’ view and contextual menu.  Navigation is simplified ‘Model Explorer’ view is customised to ease the ready of objet navigation. Tree organisation is similar to ‘Variable’ view of Debug perspective. How to use Topcased Simulation - Tutorial Page 14 2012-12-12

15 Getting details on running system  Via ‘Console’ view -Process Console is created on Simulation start. -Semantic errors are printed in red. -Signal occurrence without destination are displayed with their content. -Console is based on ‘Process console’ of ‘Debug’ perspective: Standard operations are available: Stop, clear, stop scrolling, pin, … How to use Topcased Simulation - Tutorial Page 15 2012-12-12

16 Classification and structures  Classes and components can be instantiated.  Composed attributes are used to create child objects -Object classification is defined from attribute type. -Number of created object is based on attributes lower bound  InstanceSpecifications are used to describe objects to run  Type connector as interpreted on instance start action Composite diagram can be used to define relation between elements of class. Connector must be type for the simulator to identify attributes values.  Operation overriding is supported for inheriting classes  Operation implementation can be defined by an activity or an OCL OpaqueBehavior UML Supported features Topcased Simulation - Tutorial Page 16 2012-12-12

17 Structural features unsupported features  PrimitiveTypes inheritance from UML Primitives  Real primitive types is not supported  Pure association: More than 2 ends, or owning both member ends.  Constraints, TimeObservations and DurationObservations are ignored.  Template parameter are ignored for signature and unsupported for objects instantiation.  Nodes are handled like simple classes.  Navigation through Connectors and Ports are not supported, Signal target must be explicit.  Qualified properties are not supported and property options are ignored: Derived, static, read only, unique, ordered (except for OCL expression), visibility, subsetted, redefined. UML Supported features Topcased Simulation - Tutorial Page 17 2012-12-12

18 State machine  Class with classifiedBehavior must be defined by a state machine The state machine instance is created on Simulation start or on a StartClassifierBehaviorAction.  Triggers with Signal, Relative or absolute time, AnyReceive and completion events.  Internal and external Transition with guard in OCL and deferred triggers.  Composite state and multiple regions are handled.  Choice and junction can be used with guard expressed in OCL ‘else’ key word is supported for Choice and Trigger guards.  Call of activities for state ‘onEntry’ and ‘onExit’ and transition ‘effect’.  Sequencing of ‘onEntry’ and ‘onExit’ of composite states.  Signal content can be handled using transition effect with matching signature. UML Supported features Topcased Simulation - Tutorial Page 18 2012-12-12

19 Topcased Simulation - Tutorial Page 19 UML Supported features State machine  Example of signal handling -StateMachine1 is in state State1::(State1a, State1b) -Sending signal Signal2 A new consumption action will be available

20 2012-12-12 Topcased Simulation - Tutorial Page 20 UML Supported features State machine  Example of signal handling Clicking Step Into shows next event consumption action:

21 State machine unsupported features  State machine inheritance, submachine in State.  Triggers with CallEvent are not supported.  Constraints, Entry points, Exit points, History, Terminate are not supported.  Fork and Junction are not supported Can modelled using composite state UML Supported features Topcased Simulation - Tutorial Page 21 2012-12-12

22 Activity  Common unitary actions Call behaviour, Start Classifier Behaviour, Call Operation, Send Signal, Read/Add/Remove/Clear property, Read/Add/Remove/Clear property, Create/Destroy Object, Read self, Read Value Specification and Opaque actions.  Sequencing is established using: -Control and object flows, -initial, decision/merge, fork/join and final nodes.  OpaqueExpression, OpaqueAction, OpaqueBehavior and Guard must defined in OCL OCL is the default language. OCL guard can be used for Decision nodes.  Opaque action can be empty No Output Pin must be defined  ValuePin can contain OCL OpaqueExpression UML Supported features Topcased Simulation - Tutorial Page 22 2012-12-12

23 Activity  Variable values are accessible : -In OpaqueExpression of Guards and Value Specification Actions -In OpaqueAction.  DecisionInputFlow of Decision node is not supported but Decision Node can have Object Flow as incoming flow and Control Flow as outgoing flows. Guard of Decision Node can use the content of Object flow if it is produced from a Object Node (In this case, objet node must be named).  ‘else’ string is supported in decision UML Supported features Topcased Simulation - Tutorial Page 23 2012-12-12

24 Topcased Simulation - Tutorial Page 24 UML Supported features Activity  Example action sequence Execution tokens are green. Actions about to be executed are red.  Dialog box of Step buttons lists the enabled actions User can force the order of execution.

25 Activity unsupported features  Signal propagation via connector and ports is not supported Development in progress. Signal destination must be explicitly expressed by target.  Index in Write action (Variable or property) is not supported.  No Structured Node (including Loop, conditional, Sequence) is supported.  Activity partitions are ignored.  Activity cannot represent waiting state: Accept Event, Accept Call and Reply actions are not handled.  Interruptible regions and Exception handler are not supported.  Merge of Object flows and (flow weight <> 1) are not supported.  Action about association are not supported: Create/Destroy/Read/Write/Clear link actions  Miscellaneous actions are not supported: Unmarshall (use several Read Property actions), Raise Exception, Read Extends, Reduce (use OCL iterate function), Reclassify actions. UML Supported features Topcased Simulation - Tutorial Page 25 2012-12-12

26 OCL interpretation  OCL is expected for all Opaque Elements (Except empty OpaqueActions)  OCL interpretation is based on Official Eclipse plugins and meets same level of compliance (OMG OCL 2.3).  OCL expression can invoke operations of objects as long as implementation is defined by OpaqueBehavior and operation is a query.  Input pins of Opaque Action must be fully qualified: Name, type and upper bound are required.  Several output pins for Opaque Action is supported via OCL tuple: With several output, output pins must be named.  Operation oclIsInState is available for Class having a State machine as classifier behaviour. Note: In external transition, operation returns false for source state and target state.  Primitive type ‘Real’ is not supported (because of UML version)  ‘IdealClock::currentTime()’ is used to get the system current date Warning: Typed by an Integer value and not a Real value (UML version limitation). UML Supported features Topcased Simulation - Tutorial Page 26 2012-12-12

27 Word of caution  Papyrus editor is required to view system state Once closed, it can not be retrieved. At end of simulation, model will not be saved. Any modification is lost.  Currently, papyrus editor is limited to 1 instance, this impacts the usage of simultaneous simulation session. Versions -Based on Eclipse Indigo and Papyrus 0.8 (Incubation) -Conform to OMG UML 2.1.2, OMG OCL 2.3 More information… Topcased Simulation - Tutorial Page 27 2012-12-12

28 TOPCASED tutorials and examples  http://www.topcased.org/index.php?documentsSynthesis=y&Itemid=59 http://www.topcased.org/index.php?documentsSynthesis=y&Itemid=59 Acceleo documentation available online  http://wiki.eclipse.org/Acceleo http://wiki.eclipse.org/Acceleo Contacts  TOPCASED user mailing lists  nicolas.peransin@atos.net nicolas.peransin@atos.net  jean-francois.rolland@atos.net jean-francois.rolland@atos.net  raphael.faudou@atos.net raphael.faudou@atos.net More information… Topcased Simulation - Tutorial Page 28 2012-12-12


Download ppt "Topcased 5.3 Simulation of models Tutorial 2012-12-12 Topcased Simulation - Tutorial Page 1."

Similar presentations


Ads by Google