![]() ![]() |
|||
|
|||
We are ready to start creating the FSA formalism we used to build the "water" model. First of all, please reload AToM3
to reset everything we have done in the past steps. You should get this starting screen:
|
|||
![]() |
|||
Ok, let's make a quick design of what we want in the FSA formalism: |
|||
As a first step, let's setup the model attributes:
|
|||
![]() |
|||
The name property is *very* important since it will be the name of the generated file for our formalism. |
|||
You should get a screen like this:
|
|||
![]() |
|||
Before generating a partial FSA formalism, let's add an entity "state" to our meta-model:
| |||
![]() |
|||
Edit the properties of the entity0: Set up its name to "state" and add an string attribute
name
(with a default value "state0") to get this:
| |||
![]() |
|||
Now, we need to specify an appearance for our "state" entity. Indeed, we cannot build
FSA without a graphical expression for the state! In order to specify the appearance, click on the "appearance" button in the
properties of the entity:
| |||
![]() |
|||
**Note: If some attributes of the entity don't appear on the left, you may need to reload the properties screen of the entity to confirm its state. | |||
|
|||
This options is used to select/move an object on the canvas.
|
|||
|
|||
This options is used to delete an object on the canvas.
|
|||
|
|||
This options is used to draw a line on the canvas. A left-click
inserts a point in the line and a right-click confirms the drawing.
|
|||
|
|||
This options is used to draw a polygon on the canvas. A left-click
inserts points (to create angles) and a right-click close the polygon by connecting
the (x,y) position of the mouse to the starting point.
|
|||
|
|||
This options is used to draw a circle/oval on the canvas.
|
|||
|
|||
This options is used to draw a rectangle on the canvas.
|
|||
|
|||
This options is used write text on the canvas.
|
|||
|
|||
This options is used to draw an attribute of the entity on the canvas. Hence, its attributes can be part of its
graphical appearance. To use it you first click on the "attribute" button, then you select an attribute and,
finally, you left-click on the canvas.
|
|||
|
|||
This options is used to add connectors to a graphical object. Connectors are used in AToM3 to connect
objects together. Indeed, the end-point of a relationship will always be connected to a connector.
|
|||
|
|||
A left-click on an object in the canvas brings its properties screen.
|
|||
|
|||
This options is used to add python-coded constraints to the graphical appearance, allowing, for example, a change
in the appearance depending on the value of some attributes.
|
|||
| |||
In our case, we will draw a circle object with those options: | |||
![]() |
|||
Now, if we confirm the appearance and the properties of the entity, we are left with this partial
FSA meta-model:
|
|||
![]() |
|||
There is one thing left before generating the FSA formalism: add a relationship between the states!
In order to do that, we need to add a relationship from the "state" entity to itself, like this:
|
|||
![]() |
|||
Then, we just need to specify a simple graphical appearance for the relationship. Go in the properties screen of the
relationship, then select "appearance" and set the "fill" attribute to "black" in the FirstSegment/SecondSegment sections.
Also, set the name of the relationship to "transition":
|
|||
![]() |
|||
We have finished to create a partial FSA meta-model. To generate the formalism, first
save
the model in your working directory (did you
setted
it in AToM3 options?). Then, go in the "model" tab of the top menu and select "generate code".
Voila! AToM3 just generated a partial formalism for creating FSA! We will try it in the next step.
|
|||
| |||
![]() ![]() |