(this file is automatically generated from Java source)
Back to book index.

Automata Tutorial

The automata package contains support classes for DES automata. It has a lightweight design, still it is fast and efficient.

The main class is Automaton. However, to use this class, you must access it via an Automata object. An Automata is (plural for Automaton) is an object that contains all your automata objects for an specific system.This is necessary since all automata must have a well defined alphabet which is a subset of the Automata objects alphabet.

To create one or more Automaton:s, use the following code:

Next, you must create the Event:s used in your Automaton. Altough these events are mirrored in the parent Automata object, you must use unique events for each Automaton:

This also applies to State and Transition objects: The code above creates an automaton with two states (s0,s1), two events (e1,e2), and a transition from s0 to s1 labelled with e2.

There are also some important attributes in State and Event objects that you might need to change. Here are some examples, see the API documentation for a complete reference.

I/O

As the rest of the JDD, the jdd.automata package has support for loading and saving to/from XML files. This is done via the AutomataIO class:
Notice that JDD uses the Supremica XML format and is able to load/save from Supremica files. Also, to draw an automaton, you can use the Automaton.showDot() function.

Common operations

The Automaton class is an extension of the more abstract Graph class. As a result, the State class is a subclass of Node and Transition is a subclass of Edge in jdd.util.graph.

To traverse the states or transition in an automaton, use the following code: Alphabets are designed as linked lists. To traverse the alphabet of an automaton, try this: Each automaton-event has a pointer to its unique automata-event. This way, the global and local alphabets are separated but still maintain a clean relationship. Access Event.parent to get the unique event counterpart in the global alphabet. To access the global alphabet, do the following: As an example, the following code prints LOCAL events in an automaton:

Another interesting property of the JDD automata is that similar to Graph, each state in an Automaton maintain a list of incoming and outgoing transitions. Here is an example how to use this information:

misc.

The AutomataToPCG class in the jdd.des.automata.analysis package creates process communication graphs from your Automata. You might find it useful. Furthermore, the jdd.des.automata.bdd package contains basic functionality for BDD encoding of automata.


Back to book index.