• Keine Ergebnisse gefunden

3.3 GroDisc

3.3.5 Interface to LIGNUM

i n t I n c : : i n c = 1 ;

void I n c : :operator( ) ( gdLayerCompartment comp )const{

∗comp [ INT ] [ ”ID”]+= i n c ; }

Listing 8: Accumulate: example of a functor which counts layer compartments (declaration and defini-tion).

s t r u c t Count{

void operator( ) (i n t& num , gdLayerCompartment comp )const; };

void Count : :operator( ) (i n t& num , gdLayerCompartment comp )const{ num++;

}

Listing 9: ForEachPair: example of a functor which calculates minimum distance between two layer compartments (declaration and definition).

s t r u c t L o w e s t D i s t a n c e{

void operator( ) (double& d i s t , gdLayerCompartment r e f , gdLayerCompartment comp )const;

};

void L o w e s t D i s t a n c e : :operator( ) (double& d i s t , gdLayerCompartment r e f , gdLayerCompartment comp )const{

double dummy = r e f| | ∗comp ; d i s t = (dummy<d i s t ?dummy : d i s t ) ; }

3.3.5 Interface to LIGNUM

With the simulation of LIGNUM trees the necessity to analyse the simulation results arises. The analysis of the results is supposed to be done by the GroDisc software, hence a data interface is needed. Just for completeness the interface is implemented bidirectionally. The interface is partly described in Dzierzon et al. (2003). Originally it

was applied as aLIGNUM GROGRAinterface. This chapter describes this interface and, in addition, a direct interface to the GroDisc data structure.

The interface can take two routes: The first is a file connection. TheDTG file format of GROGRAis used. This file format can be used either inGroDisc or in GROGRA. The other way is a direct translation to the GroDisc data structure.

Firstly the translation ofLIGNUM trees to DTG files is described. TheDTG file im-ages the internal data structure of GROGRA, hence the interface is primary an interface between LIGNUM and GROGRA. InLIGNUM as well as in GROGRA the information of interest in a simulated tree is stored in a data type which basically represents the organ

”tree segment”. The task was to collect the tree segments out of a LIGNUM tree and to filter the attribute information out of the segment. In order to translate trees from LIGNUM into the DTG format it is necessary to consider two items: the information stored in tree segments itself, and how those segments are linked together, i.e. the repre-sentation of topology. The reprerepre-sentation of topology is different in both tools. For this reason a translation process is needed. Focusing on a segment,GROGRAstores informa-tion in the data structure of the segment about the locainforma-tion of this segment within the tree architecture. Every segment ”knows” its predecessor, that is mother segment. All of the segments are chained in a list. The list itself does not represent the context of tree segments, but the ”knowledge” of mother segments satisfies the minimum demands posed by representing topology.

The data structure ofLIGNUM represents topology in a more implicit way. As already described, tree segments are merged in lists which describe axes in the systematic of Gravelius order (cf. figure 10). Querying such a data structure is a rather complex process. In this case the mother segments for each segment have to be calculated. If one scanned tree segment by tree segment through this list of lists, it would be not guaranteed that the predecessor element is the mother segment - usually it is not. LIGNUM offers algorithms to solve such problems. One of them allows querying the structure considering the topology. At a branching point the algorithm allows to treat daughter segments in a quasi simultaneous way. This allows to pass the information ”who is the mother” to the daughter segments.

The information of a tree segment can be subdivided into three parts: identification, geometrical and physiological information. In the filtering process information can take three different ways: direct adoption, transformation, and sometimes information has to be calculated newly out of existing data.

Table 6 shows the physiological information whichLIGNUM holds in a segment. The DTG format provides space for five unspecified variables which can be used for whatever

information is required. Table 6 shows the physiological information which is stored in a LIGNUM tree segment. These five attributes are adapted in the translation process.

Part of physiological information stored in a LIGNUM tree segment

Foliage mass Sapwood mass

Dry weight Respiration rate Radius of heartwood

Table 6: Selection of physiological information of aLIGNUM tree segment

The converter translates the LIGNUM tree directly into a GROGRA 3D structure in the form of a DTG ASCII file. Technically the converter uses the LIGNUM libraries to build up a LIGNUM tree. The DTG file is readable by GroDisc. That opens a data connection from LIGNUM to GroDisc.

However, it is possible to convert a LIGNUM tree directly into GroDisc tree. If this happens all physiological information is stored into the GroDisc tree segments and can be processed during algorithmic analysis. The advantage of direct translation is that all attributive information can be stored into the GroDisc structure. The appendix on page 146 shows the functor which is used for that purpose. The way is the same as in the LIGNUM DTG connection. The only difference is that the argument of the functor is not the file but a GroDisc tree.

The translation process of GroDisc toLIGNUM trees is more complex. The topolog-ical information is stored very differently. The main problem is to calculate the topology out of the GroDisc orDTG structure, respectively. It is possible to take advantage of the fact that both the LIGNUM tree segment and the GroDisc unit have an identifier in the form of an integer variable. Figure 16 illustrates the translation process of the topology on a simple virtual example.

If the origin of data is a DTG file, the data are read into a GroDisc tree. The GroDisc tree is then accumulated. The GroDisc tree units are ”collected” and put into a LIGNUM tree. The problem was to identify the position of a segment within the LIGNUM tree. Two functors are necessary for that purpose: one which sends the signal through the GroDisc tree and one for the LIGNUM tree. The functors are given in the appendix on page 146. The identification of the position is done by the mother

segment concept. In a first step, the first segment at the base of the tree is inserted to the LIGNUM tree. During the following accumulate process through theLIGNUM tree, the mother segment of the reference unit is looked for. If the mother segment is found, the position of the GroDisc tree unit within the LIGNUM tree is almost known. At this moment, however, it is not clear whether the segment follows the axis or whether a new axis has to be created. The Gravelius orders of the mother and reference unit answer that question. If the orders are identical the reference unit is a unit within the same axis. In that case a LIGNUM branching point and a tree segment is built and inserted into the axis list. If the orders are different a new axis has to be created. The axis is inserted into the corresponding branching point of the mother unit. The new axis also gets inserted the daughter segment. If a new axis is inserted to a branching point, LIGNUM makes sure that a terminating bud is put to the end of a list (using the function InsertTerminatingBud(BranchingPoint<TS,BUD>& bp)).

Figure 16: The translation process of the GroDisc LIGNUM interface. TU =GroDisctree unit, TS =LIGNUM tree segment, BP = branching point.