Creating a finite state automata model


Now we will view in detail how we can create a FSA with ATOM3. If you are not familiar with Finite State Automata, we strongly suggest that you visit the very small tutorial in the ressources even if we will go over the basic concepts in this tutorial. Now, if you have correctly followed the previous steps, you should see something like that on your screen:  

 

As you can see, the FSA formalism is loaded on the left of the canvas. From the "state" button, you can add states in the canvas and connect them through transition with the "connect" button.

There are two main things to keep in mind when creating a FSA with ATOM3:

Setting the allowed input/output for you model
Designing the model in the canvas

To Set the input/output, click on "Model" and then select "edit model attributes":  

 

Then, as you can see on the next picture, we can specify various attributes for the model. Its always a good idea to specify the author and description for documentation purpose. Sometime, the model name is used by ATOM3 to generate several files, so it is preferable to specify it:  

 

Now, if you click on "Input_alphabet", we will be able to add possible inputs for the model. After clicking, the interface for a list of strings will appear. You can "add", "edit" or "remove" elements that will constitute the valid list of inputs for your model. We decided to create a simple model of water entering into a "boiling" state so a valid input could be "Heat". We clicked on "new" and typed in "Heat":  

 

Following the same procedure, we can add an output:  

 

Ok, now it is time to design the model in the canvas. First, we click on the button "State" (on the left) and we click on the canvas to add one state:  

 

Then we click on the "Edit entity" button on the top of the canvas, after that we select the state we just added to setup its properties. In our case, we set the state to "normal" (non-boiling) and it is the initial state:  

 

We add a new state on the canvas and do the same steps to setup its properties. We set its name to "boiling" and it is the final state:  

 

Now, it's time to connect the two state and relate them with the input "Heat". In order to connect them properly, we must first click on "Connect" on the top of the canvas. Then, we click on the source object (Normal) and finally we click on the target object (Boiling) to get this:  

 

After that, we will edit the input/output of the connection we just created. We do that by clicking on "Edit entity" and then clicking on the connection. We set the input to "Heat" and the output to "Steam". Take notice that if we had not added "Heat" and "Steam" to the lists of allowed inputs/outputs, ATOM3 would have prevented us from setting them:  

 

Finally we get our FSA:  

 

We can save it by clicking on "file", then on "save as". We save this model in the FSA formalism
**Note on naming conventions: nameofyourmodel_nameoftheformalism_mdl.py ** <-- start with small letter.
Also, it's always a good idea to save everything in your working directory.