Main content area

A design pattern in XL for implementing multiscale models, demonstrated with a fruit tree simulator

Kurth, W., Ong, Y.
Acta horticulturae 2017 no.1160 pp. 35-42
biomechanics, computer software, engineering, fruit trees, internodes, models
Integration of processes and structural developments at different scales in plant models requires additional implementation effort in comparison with single-scale models. Here we propose a method to organize and reduce time taken to implement these models with the example of a simple fruit tree model with architectural and biomechanical components. The example includes scales such as axes, growth units, internodes, as well as a simplified branch bending mechanism. Our approach uses the so-called “observer pattern” in the class of formalized practices in software engineering known as design patterns. It allows automatic triggering of inter-scale processes after registering the relationships and dependencies between scales during model initialization. Our technique is implemented as an extension to the programming language XL, which is based on Java and parallel graph rewriting, and is available on the software platform GroIMP. By first establishing an overall graph structure reflecting the scales which occur in the model, functions invoked by the registered dependencies, i.e. observers, adhere strictly to model design with reduced inter-function calls. Furthermore, objects from the different scales, which can also stand for aspects of the model, can be visualized separately.