AnimB start

From Event-B
Revision as of 05:45, 5 June 2009 by imported>Christophe (→‎New animation wizard)
Jump to navigationJump to search

Start an animation

To start an animation, select a machine in "Project explorer" or in "Obligation Explorer" then click right and select "Animate" action. Then "new animation wizard" is open.

Rightclick.png


New animation wizard

Generality

The "Run AnimB" wizard allows to start an animation of a event-b model. The wizard is composed of two field:

  • "Animation name" field allows to set the name of the animation. The animation name identifies an animation and could be used to shared animation between application clients. You can use the default value.
  • The combo list "Last model" fixes the more abstract model use to build the animation.


Note: If you choose a name already used for an open animation, then you will obtain a second editor but the two editors will display the same animation.

Example

Suppose a refinment column composed of 5 models:

  • CrsCtl_m0
  • CrsCtl_m1
  • CrsCtl_m2
  • CrsCtl_m3
  • CrsCtl_m4

and you run the wizard under the "CrsCtl_m4" model.
The following picture display the setting to run a animation called CrsCtl_name. The animation will execute the two following model.

  • CrsCtl_m4, the more concrete model
  • CrsCtl_m3, the more abstract model used for the animation

You can use this feature to animate one model.

438:px


The animation editor

The animation editor contains :

  • a page for each model
  • a page for each context seen by a model


The following screenshot describes the animation editor for an animation of the models brp_3 and brp_2 which refer the contexts brp_ctx3, brp_ctx_2 and brp_ctx_1 :

638:px

Model page

The model page is split in two parts:

  • the first part contains the list of the event of the corresponding model
  • the second part describes in a table the list of the variables and the list of the seen constants and there values.

Event guard state

The state of an event guard is described by the following icons:

  • guardclosed.png the guard of the event is closed and can't be executed.
  • guardopen.png the guard of the event is open and the event can be executed.
  • unexecutable.png the guard can't be checked (constant value needed, well defined error, ...).

Component tabs

Each animated machines and its contexts are described in a specific tab. The following screenshot describes a context tab.

639

Variables table

The variable table or constant table describes the state of a machine or context.

The variable changes by the lest event execution are typeset in red.

LastChange.png

Execute an event

To execute an event:

  • click on the corresponding event in the event table or
  • click on the "random execution" button : in this case the animator chooses randomly an open event and executes it.

The last executed event is described by a gold arrow:

  • GuardClosedEx.png when the event is closed
  • GuardOpenEx.png when the event is open

Manage constante values

The animator need constant value to animate a model. Be aware that no check is done by the animator so you can set any value.

Record constant value set

In the "Synthesis" tab of a context you can record a constant value set. The following button Applied.png creates a constant value set.

Apply the constant value set

Once an animation start, you must set constant values by either:

  • selecting a recorded values set with the corresponding combo
  • editing manually the constant values in the tab

After editing the values, you to need to click on the "Apply" button for them to be taken into account.

String integer value

A string is considered as an integer. So, in order to ease the understanding of the animation behaviour, you can use meaningful strings instead of integers for carrier-sets or constants belonging to a carrier-set.

The following screenshot describes a constant value set in the "Synthesis" view with string value:

StrVal.png