The L-System Editor

L-system Input Pane

As always, this documention assumes some general familiarity with L-systems and only describes JFLAP's implementation of these structures. JFLAP allows a user to define an L-system and to render that system with an arbitrary level of substitution in three dimensions. The formal definition of an L-system requires three components, to which we add one to aid in drawing:

System alphabet
JFLAP does not require the user to explicityly set the alphabet (i.e. set of recognized symbols) of the system. If a symbol is does not have significance to whatever is attempting to interpret it is ignored, e.g. a renderer of an L-system would be interested in those symbols that affect the rendering and those symbols which have replacement rules.

While the rules of replacement, the presence of an axiom, and soforth are universal to L-systems, the interpretation of those symbols to render a graphic is not part of the mathematical definition. At present there is one L-system renderer in JFLAP, and its description, including the symbols it recognizes, may be found here.

Axiom
At the top of the editing view is a text field for typing in the axiom labeled, appropriately enough, "axiom." As mentioned before symbols are space delimited. In the example given above, the three symbols in the axiom are +, g, and L, in that order.

Rewriting Rules
Below the axiom is a series of productions that represent the replacement rules; one enters these just as one would enter productions for a grammar. As with the axiom, the symbols on the right must be space delimited. There may be only one symbol on the left. The two rewriting rules in the example picture are L L + R g + and R - g L - R, that is, going from one level of substitution to the subsequent level of substitution, every L shall be replaced with the five symbols L + R g +, and every R shall be replaced with the five symbols - g L - R.

It is entirely possible to have multiple replacement rules for the same symbol. If the user enters multiple replacement rules, one of the rules will be chosen uniformly at random when the expansion of symbols occurs. Additionally, lambda productions are allowed and indicate simply that the symbol should be removed.

Drawing Parameters
Below the grammar input, and at the bottom of the window, there is a table the user may set parameters that affect the rendering of the L-system. The user enters the parameter name in the left column, and its value in the right column. In the example L-system input figure, we have the two parameters named angleIncrement and distance, with values 90 and 4 respectively. Mind you, these parameter names are case sensitive! If the same parameter is defined multiple times in the table, only the last definition of the parameter is respected.

Above the right scroll bar, just to the right of the "Parameter" column label, there is a small button. If you press it, you will see a popup menu with a list of those parameters the L-system renderer in JFLAP recognizes (one can't remember them all, can we?). For a full description of these parameters, view the pages for the L-system Renderer When you select a parameter name from this list, it will be entered into the table, and you will begin editing the value for that parameter. If you select a parameter that already exists in the table, then you will begin editing the parameter value for the existing entry.