• Keine Ergebnisse gefunden

The detailed description of the whole syntax and semantics is also explained in Kurth (1994) and Kurth (1999). The L-system specification of GROGRA is used for stand simulation purposes in this work. For a better understanding of the rule based computer code, the used keywords, turtle commands and sensitive functions are demonstrated.

2.3.1 Turtle commands

The three-dimensional structure in GROGRAis represented by turtle geometry (Abelson and diSessa 1982). The turtle geometry is created by a virtual turtle which executes com-mands. The commands are specified in the growth grammar and appear in the resulting string. Table 1 shows all commands which are used in this work. The table shows also the meaning of the command and the local or persistent effect of attributes. The most important commands are F and RH, RU, RL. F means “forward” and orders the turtle to create an elementary unit of cylindrical shape which may be part of a tree. If the turtle shall step forward without creating a unit the lower case f is used. RH, RU, RL let the turtle change the direction (cf. figure 9) using rotation vectors. During the creation of a unit attributes are given to the unit. The values of the attributes can also be set by turtle commands. The attributed turtle commands can have local or persistent effect. All commands with an additional lower case l letter have local effect. “Local” means that the value is only valid for the next following F symbol and not persistent for all following symbols. Brackets denote the beginning and the end of branching (cf. listing 1). The repetition operator tells the turtle that she has to repeat the following commands. The scope of repetitions is denoted by “lower than” (<) and “greater than” (>) symbols.

The command T was added for special purposes in stand modelling and is used in the L-systems which are created here. The chapter 2.4 is dedicated to the extensions which are made for the special purposes of this work. Hence the command T is explained there.

2.3.2 Variables

The growth grammar specification allows to declare variables and constants in the heading of the L-system. Four different types of variables are used:

• stochastic variables,

• sensitive variables,

• local register variables,

• index variables.

Stochastic variables allow to specify numbers which are generated at runtime by a pseudo-random number algorithm and which follow a certain distribution. Different types of stochastic distributions are available. Here the uniform and normal distribution are applied. Sensitivity is explained further on. It is one of the main extensions in the growth

Command Meaning Effect

F forward by generating a unit

-f forward without generating a unit

-S store position of turtle

A set value of local variable local

& repetition

-Table 1: Turtle commands. For more commands see. Kurth(1999)

grammars, compared with classical L-systems. Sensitivity returns information about the structure to the L-system. Functions are existing which query the structure (see chapter 2.3.3). But also the length or diameter of elementary units can to be stored in a variable.

Kurth(1998) introduced the local register. It is attached to an elementary unit and hence local. It is possible to alter the value of this local variable with the turtle commandA. An index is a counter which increases its value automatically with each repetition within the scope of repetition operators. Listing 2 shows examples for the declaration. In line one a constant con with the value 8.0 is declared. Line two declares a uniformly distributed stochastic variable with values from the interval [0; 100]. The keyword lengthin line three indicates, that the length of units is stored in the variable. And in the last line a local register variable locis declared.

Listing 2: The declaration of constants and different forms of variables in growth grammars.

\const con 8 . 0 ,

\var u n i uniform 0 1 0 0 ,

\var l length,

\var l o c l o c a l ,

2.3.3 Growth grammar extensions

One main extension of the GROGRA specification are globally sensitive functions (cf.

Kurth and Sloboda 1999b). During the interpretation process in insensitive grammars it is not possible that a generated structure has backwards effect on the application of the rules. Shading calculation for instance is such a problem, where existing structure exerts influence to structural growth in the following steps. The sensitivity allows to take such processes into account. The user can specify functions which are able to investigate the structure. The function returns values which can be used within the grammar. Figure 3 shows the flow of control which is taking place by applying sensitive rules. This figure additionally shows the functionality of interpretive rules. They are also an extension of the classical L-system approach. Interpretive rules have no influence on future structures.

Primary the generative rules are applied which create the new string. By application of the interpretive rules the structure is created. Interpretive rules are optional, but they make sense in certain situations.

Table 2 presents the sensitive functions which are used in the stand modelling L-systems. The functions 14 and 15 are created for the needs of tree stand modelling and are described in detail in the next chapter.

Function 8 (f8) calculates the degree of occlusion of the sky hemisphere. It serves to simulate competition for light. The competition for light is assumed to result from local shading processes. The hemisphere is discretized after den Dulk (1989). He divided the hemisphere into sky segments which donate light. The segments are represented as directions. The sensitive function f8 investigates from the point of view of a reference unit each sky segment and counts if it is touched by another unit of the structure. The returned value is the ratio between touched and non touched segments. Function 15 (f15) does essentially the same. The only difference is that each touched sky segment is weighted with the sine of its inclination angle. Hence sky segments near to the horizon have much lower significance compared with segments near the zenith.

sumis not a sensitive function but requires sensitivity. It is not used in this work, but shows that also sensitive operators are existing. sum is an arithmetical operator which accumulates attribute values of tree units in the branching system which emerges distal to a reference unit. The operator gets two parameters. The first one is a condition and is optional. With this condition is it for instance possible to exclude all units with an empty needle parameter from calculation. The second parameter is essential and specifies the type of information which shall be accumulated. The type is characterized by a sensitive variable like the length or diameter of tree units.

Function Meaning

f8(col) Occlusion of sky. The sky hemisphere is discretized afterden Dulk(1989) into seg-ments. A segment is considered to be covered if from the viewpoint of a reference unit a tree unittouches the hemispherical segment. The variablecol specifies units which shall be excepted by colour.

f14(col) Calculates the distance between the end point of a tree unit and the surface of the next triangle in a certain direction. The triangle has to be generated with command T(e1, e2, e3) in the L-System. The variablecolspecifies units which shall be excepted by colour.

f15(col) Like function 8, but each touched sky segment is weighted with the sine of the inclination angle of its corresponding direction.

sum(cond,var) The arithmetical operatorsum accumulates the sensitive variablevarover a branch-ing system distal to the reference unit.

Table 2: Used sensitive functions (fn) and the operator sum; seeKurth(1999). col denotes the colour of an element anden are the nodes of a triangle.

a s

1

s

2

s'

1

s'

2

s

1

s

2

. . .

. . .

. . .

Interpretation

Structure creation

Sensitivity

Figure 3: The structure creation steps during application of a sensitive growth grammar. α, σi, σi0 denote strings,Si geometrical structures. The interpretation and sensitivity step is optional (cf.Kurth and Sloboda 1999a,b).