You are here

Using a submodel to specify a satellite relationship between one object and another

Let’s say that you have a multiple-instance submodel containing information on the species and volume of a set of individual trees: each instance is one tree. You would like to find the total volume of all trees belong to species 1.

This is easy to do if you have model the trees using a fixed-membership submodel (i.e. assuming that you have a fixed number of trees). You simply take influence arrows from the species and volume variables inside the submodel to a variable outside (say total), and give total the equation:

total = sum(if [species]==1 then [volume] else 0)

[species] and [volume] are both arrays with the same number of elements, and Simile’s array language matches them up.

However, if you use a population submodel to model the trees, then you have a problem. A population submodel exports a list of values rather than an array: it has to do this, because the number of values can change dynamically, rather than being fixed. Currently, Simile does not have a list-processing language corresponding to the array-processing language as above. All you can do with a list is to sum it, count the number of elements in it, or find it minimum or maximum value.

The satellite submodel is a mechanism for dealing with problems like this. In the above case, it would involve creating a new submodel for the species 1 trees, using a single role arrow from the tree submodel to this satellite submodel, and entering the condition “species==1”. An instance of this submodel will be created for each tree of species 1, and not for the others. If you then take the “volume” value into the submodel, then you can extract the volumes just for species 1.