L-system generator

From WandoraWiki
Revision as of 11:35, 11 December 2008 by Akivela (Talk | contribs)

Jump to: navigation, search

Wandora's L-system generator is used to construct topic map graphs using formal grammar called L-systems. L-systems are generally known as iterative computational methods used to generate self-similar fractals, usually plants and other biological organisms.

Wandora's L-system generator starts with File > Generate > L-system generator.... Option opens a dialog with two tabs: L-system and Parser. By default the L-system tab is active. L-system tab is used to enter actual L-system to the generator. Below is a snapshot of L-system tab view in Wandora. Tab contains also drop-down-selector to select ready-made L-systems. User can also store his/her own L-system by clicking new button and entering name for the L-system into a dialog Wandora opens. Wandora stores L-systems to options.


L system.gif


L-system contains in Wandora

  • An initiator
  • One or more rules

Initiator is the first line in L-system. It is usually an alphabet or set of alphabets. Initiator initializes the L-system string. For example, the snapshot above has an L-system with initiator x.

L-system rules have always two parts: Predecessor and successor. Rule is executed whenever L-system generated string contains predecessor. Predecessor is replaced by successor string during the rule execution. For example, the snapshot L-system above contains one rule where predecessor is x and successor is a[xx].

L-system execution continues only limited time. Each execution step is called iteration. Text field below the L-system definition text area contains number of L-system iterations. As L-system string may grow exponentially large it is suggested you not to use more than 10 iterations unless you are sure about the outcome of L-system.

As iteration continues the initiator string is gradually changed by rules. For example examining the snapshot above initiator x is changed:

0: x
1: a[xx]
2: a[a[xx]a[xx]]
3: a[a[a[xx]a[xx]]a[a[xx]a[xx]]]
4: a[a[a[a[xx]a[xx]]a[a[xx]a[xx]]]a[a[a[xx]a[xx]]a[a[xx]a[xx]]]]
etc.

As you notice, the string grows very rapidly.

L-systems itself carry no interpretation of generated string. Generated strings are semantic free, you could say. This reflects to Wandora's L-system generator feature also. L-system string generation is separated from the interpretation. Interpretation is handled by special L-system string parser that reads the generated string and interprets each token in the string.

L-system string interpretation

Typically L-system string is interpreted to turtle commands such as move forward, draw line, and turn left or right. However, such interpretation has implicit assumption of external environment. If you consider plain graphs, there is no such external world we could refer. Thus Wandora interprets L-system string little different compared to usual L-systems. The vocabulary and it's interpretation are

a creates a topic and associates it with previously created topic.
[A-V] create named topic and associate it with previously created topic. Named topic merges with previously created topic with same name. Unfortunately vocabulary supports only 23 different named topics.
[eiouy] create a colored topic and associate it with previously created topic using colored association. Colored topic means here that topic is typed. Colored association means here that the association type is different compared to a. Notice the set is equal to vocals (a taken out).
:[a-zA-Z1-9] change global color i.e. topics and associations are colored after this point.
:0 reset global color.
( start sequential block.
) close sequential block.
[ start parallel block.
] close parallel block.
{ start cycle block.
} close cycle block.
- subtract topic counter by one.
+ add topic counter by one.
0 reset topic counter.
Personal tools