You are here

Simile techniques

Data-specified association between instances of the same submodel

ModelId: 
data_specified_assoc2
SimileVersion: 
soc2 Simile version :

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

 

 nodes and arc graph

Category: 
Technique
Equations: 

 Equations in ../Desktop

IDa = [1,2,3]
IDb = [2,3,4]

Equations in Node
ID = index(1)

Equations in Arc
cond1 = (any(ID == [IDa]and ID_0 == [IDb])or any(ID == [IDb]and ID_0 == [IDa]))
where
ID = ../Node/ID (from Node in role1)
ID_0 = ../Node/ID (from Node in role2)
[IDa] = ../IDa 

 

 

Data-specified association between two different submodels

ModelId: 
data_specified_assoc1
SimileVersion: 
3.1+

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

 

 household, field

 

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)

 

 

 

Subscribe to RSS - Simile techniques