L-SYSTEMES et ARBRESDavid G. Green,
ANU Bioinformatics Facility
texte adapté parGilles Hunault,
Un système L simple contient 4 types d'éléments" :
p.e. L'expression
variables : A B
constantes : (aucune)
règles : A -> B
B -> AB
départ : A
Ce système L produit les chaines suivantes :
Si on compte la longueur de chaque chaine, on obtient les nombres de Fibonacci :
1 1 2 3 5 8 13 21 34 ....
A -> DB
B -> C
C -> D
D -> E
E -> A
Here is the pattern generated by this model. It matches the arrangement of cells in the original alga.
Stage 0 : A
Stage 1 : D B
Stage 2 : E C
Stage 3 : A D
Stage 4 : D B E
Stage 5 : E C A
Stage 6 : A D D B
Stage 7 : D B E E C
Stage 8 : E C A A D
Stage 9 : A D D B D B E
Stage 10 : D B E E C E C A
Stage 11 : E C A A D A D D B
Turtle geometry, invented by Seymour Papert, deals with patterns produced by the path of an imaginary turtle moving around on a plane. The path of a turtle can be described by a sequence of symbols representing the moves that the turtle makes as it moves around. These sequences form words in a formal language, defined by a grammar such as the following:
Constants = {nF, nB, aR, aL, Stop },
Variables = {, , , ...},
Start =
where
nF denotes "n steps Forward"
nB denotes "n steps Back"
aR denotes "Turn a degrees Right"
aL denotes "Turn a degrees Left"
and the basic production rules are:
In this grammar, the variable Path denotes the (as yet) unspecified part of the turtle's trail. The transitions represent moves made by the turtle. At any time, the completed portion of the turtle's path is specified by a sequence of individual movements, such as
"4F 90R F 90R F 90R "
Turtle geometry is frequently used in computer graphics. Models that form complex patterns are obtained by augmenting the above grammar with new variables to denote particular pattern elements, and with new rules governing the structure of those patterns elements, hence the list of variables in the above definition is left open ended. For example, the following rules use the variables Design, Arm, etc to describe the formation of the simple design shown in the Figure (a). Part (b) of the figure shows a random walk.
Leaf1 { ; Name of the l-system, "{" indicates start
; Compound leaf with alternating branches,
angle 8 ; Set angle increment to (360/8)=45 degrees
axiom x ; Starting character string
a=n ; Change every "a" into an "n"
n=o ; Likewise change "n" to "o" etc ...
o=p
p=x
b=e
e=h
h=j
j=y
x=F[+A(4)]Fy ; Change every "x" into "F[+A(4)]Fy"
y=F[-B(4)]Fx ; Change every "y" into "F[-B(4)]Fx"
F=@1.18F@i1.18
} ; final } indicates end