Namespaces

This forum is for discussion of the System Dynamics model representation standard XMILE. Discussion here will be monitored by the Society's technical standards committee with ideas and concerns conveyed to the OASIS Technical Committee responsible for defining the standard.
Forum rules
Please note: By posting here you grant permission to the Society Technical Committee members to repost with attribution on the OASIS discussion forum. If you have material for which you wish to maintain copyright control please post a link to the copyrighted work.
Post Reply
Robert Eberlein
Site Admin
Posts: 179
Joined: Sat Dec 27, 2008 8:09 pm

Namespaces

Post by Robert Eberlein » Mon Aug 05, 2013 6:23 pm

When using model based namespaces it is the instantiation of the model not the model that is key to determining unambiguously which variable to use. For example suppose we have

a = nmod1.out

where nmod1 is a nested model with the variable out. If that same nested model were used with different inputs we might have

b = nmod1.out

but we don't want a and b to be the same. So we might instead use

a = nmod1.instantiation1.out
b = nmod1.instantiation2.out

(or something similar such as nmod1:instantiation1.out which would make it easier to parse nested usage).

The instantiation itself would need to be named when it is invoked. There are several ways to do this, but keeping it as part of an equation rather than embedded in the schema would increase flexibility and allow for the possibility of an indeterminate number of instantiations.

For example

nmod1:instantiation1.input1 = aa

If there were only a single instantiation then

nmod1.input1 = aa

or the equation

input1=nestingmodel.aa

as part of nmod1 would accomplish the same thing.

In the case of on the fly instantiation, as might occur with agents, we would need to look at attributes of the instantiated entities rather than their names. For example we might have

a = nmod1:where age < 7.count

this is beyond version 1 of the XMILE Spec, but seems like it would be a natural extension of the name:id format suggested (or any other delimited identifier).

Magne Myrtveit
Posts: 57
Joined: Mon Jan 12, 2009 6:52 am

Re: Namespaces

Post by Magne Myrtveit » Sun Aug 18, 2013 9:07 am

Hi Bob,

What about letting every instance have its own name? This way instances can be addressed simply by using their names.

I don't know much about agent-based models, but from what you write, each instance of an agent might be looked upon as a vector inside the agent class, addressed via subscripts (1-N).

If an instance is reached via its name, we do not need to specify the name of the "class" of the instance when referring to it. This will remove the need for colon (:) or something similar for building names involving "instance-of-class".

Best regards,
Magne

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest