Workaround for dynamic subscripts?

Use this forum to post Vensim related questions.
Post Reply
Conn
Newbie
Posts: 1
Joined: Fri Oct 14, 2005 8:33 am

Workaround for dynamic subscripts?

Post by Conn »

(Just starting with Vensim and having trouble with some of the limitations of arrays).

I have this model of communications traffic between three headquarters, of which a fragment is:

--------------------------------------------------------------------------
receiver:
HQ1,HQ2,HQ3
~
~ |

sender:
HQ1,HQ2,HQ3
~
~ |

InterHQ Comms Capacity[receiver,sender]=
0,12,12;12,0,12;12,12,0;
~ Bits
~ |

----------------------------------------------------------------------

Notice the rather nasty hack here. A HQ cannot send to itself, so I have assigned the unlikely value of 0 for such cases. That way, this physically impossible traffic at least never increases during the simulation, but it is still there.

Obviously, a more elegant thing to do would be to declare that, if the receiver is HQ1, then the senders can only be HQ2 and HQ3. But I can't quite see whether it is possible to do something like this in Vensim, or whether I have hit an expressiveness wall. Any suggestions please?
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

subscripts

Post by LAUJJL »

Hi

One best solution is to express the information of the possibility to communicate in a variable like
InterHQ Comms possibiliity[receiver,sender]=
0,1,1;1,0,1;1,1,0;

this way you separe the possibility to communicate with the quantity of communication.

you can find the same problem looking for 'mapping subscripts' in the index of the Vensim help system.
It shows the same kind of problem for prerequisite tasks, that looks very much like yours.
Regards.
J.J. Laublé
Post Reply