You are here

Model entry

Data-specified association between two different submodels - Model catalogue - Simulistics.com

Search Simulistics Model catalogue Listed by keyword Listed by ID Listed by title Listed by date added

Data-specified association between two different submodels

Model : data_specified_assoc1
Simile version : 3.1+
Date added : 2003-06-20
Keywords : Simile techniques ; Association submodel ; Fixed-membership submodel ;

Description

This model demonstrates how to set up an association between submodel instances using a data file containing pairs of instances.

In this example, the association is between two separate submodels: 'household' and 'field'. The association can be considered as one of 'ownership' or 'access': i.e. it specifies which household has access to which field. Since the association is arbitrary, we need to specify it using pairs of (household,field) values.

Files

Model file

Click on the icon to download the model file. (You will need Simile to examine and run the model. A free evaluation version is available from the products page.)

Some browsers may attempt to display the model file, rather than open it in Simile; in this case, use the browser back button to return to this page, and use the context menu (invoked by right-clicking on the link) to save the target file to disk.

data_specified_assoc1.sml

Diagram

Equations

Equations in ../Desktop
       hs = [1,1,2]
       fs = [3,4,4]
Comment: This two arrays together specify that household 1 owns fields
         3 and 4, while household 2 owns field 4 (part ownership allowed!)

Equations in Household
       h = index(1)

Equations in Owns
     cond1 = any(var1 == [hs]and f == [fs])
            where:
            var1 = ../Household/h (from Household in owner)
            f    = ../Field/f (from Field in owned)
            [hs] = ../hs
            [fs] = ../fs

Equations in Field
variable:f = index(1)