[home] [info] [docu] [examples] [download] [contact] [applications] [bugs]

AGG  Version 1.0.0b

Examples and Screenshots

Contents

Here are four sample AGG applications showing how to program with graph transformation, and how to integrate Java programs.

Example

Description

Computing n!
with a simple
actor system
This is a very simple, introductory graph grammar explaining how to combine graph transformations with computations on attributes in AGG.
Operations of a
shipping company
This example shows some simple excerpts of the specification of the business processes of a shipping company. It demonstrates how to use simple Java dialogs to interact with the user of the grammar, and how to access the underlying system resources, e.g. to obtain the current date. Furthermore, the rule Fusion is a good example for the use of non-injective rules. See also the Shortest Path example below for how the tour scheduling problem of a shipping company may be solved using graph transformation.
Visualizing a
directory tree
and browsing
HTML files
This grammar performs a recursive scan of a directory of your filesystem for HTML files and represents the directory tree as a graph. Afterwards, it starts up an HTML browser to inspect the files that have been found. The files already visited are being marked in the graph. This example demonstrates how you can access system resources like the file system using Java method calls in graph rules. It also shows how you can control an external Java application (here: the browser) by graph transformation rules.
Finding the
shortest path
Given a virtual map as start graph, this graph grammar is able to compute the shortest path from some start to some goal position. The well-known Branch-and-Bound algorithm is realized by the graph rules. To solve the problem, a search tree is build up by tracing through possible paths beginning at the start node. The lengths of partial paths already found are compared and the minimal one is further expanded. Expansion continues until there is a path reaching the goal that is of length equal to or shorter than all incomplete paths terminating at open nodes.

How Graph Grammars are interpreted

The means for specifying control flow (i.e. the order in which the graph rules are applied) are still quite limited in this version of AGG: When starting automatic interpretation with the menu Transform->Start, rules are applied in the order they are arranged in the tree view on the left-hand side of the main window. At this, each rule is applied as often as possible before proceeding to the next one. If the last rule of the grammar has been processed, interpretation begins at the first rule again. This procedure continues until there's no rule applicable any more. (See the Shortest Path grammar for an example where it is necessary to have multiple passes over a rule set.) You can re-arrange the order of rules in the tree view by clicking and dragging on a rule name with the middle mouse button, or alternatively by choosing Move in a rule's context menu (right mouse button), then clicking on the target position. Additionally, you can insert a special "stop mark", denoted by a red row of hashmarks. Rules which are put below this mark will not be considered for automatic interpretation; they can only be applied individually, using Transform->Step. (See the Browser example below for a case where this mark is convenient.)

Revision: