Refering to a 2D subscript value

Use this forum to post Vensim related questions.
Post Reply
ajclarke
Junior Member
Posts: 13
Joined: Thu Apr 08, 2010 7:37 am

Refering to a 2D subscript value

Post by ajclarke »

I have an auxiliary with a subscripted range of two dimansions.
e.g. MembersofParliament[Constituency,Party]
Subscript values ( names of the members of the subscript ) are A,B,C etc. for the constituencies, and Conservitive,LibDem,Labour etc. for parties.

The value of the cell is the number of members who stand in each constituency for that party (normally 1 but can be 0 or 2).

Am I right in thinking that sum(MembersofParliament([A,Party!]) will give how many people stood for the seat A, and that sum(MembersofParliament([Constituency!,Labour]) will give the number of labour candidates in the whole election and that sum(MembersofParliament([Constituency!,Party!]) will give the total number of people standing for election?

Also I have another auxiliary TargetSeat[Party] that has the seat that they party wants to win e.g. TargetSeat[Labour] = 29 means they want to win the 29th seat in the list of constituencies. If I wanted to set the value of the target seats for each party would the logic for setting MembersofParliament say something like:

if then else( Constituency = TargetSeat[Party], 1, 0)
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Am I right in thinking that sum(MembersofParliament([A,Party!]) will give how many people stood for the seat A, and thatsum(MembersofParliament([Constituency!,Labour]) will give the number of labour candidates in the whole election and that sum(MembersofParliament([Constituency!,Party!]) will give the total number of people standing for election?
Correct.

I don't really follow the 2nd question. But try it and see if it does what you want it to.

Tony.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

You have the sums right. You probably have the TargetSeat logic right, but I suspect that formulation would not work as well as setting a Seat Attractiveness[Constituency,Party] and then allocating resources based on this (see for example product attractiveness in the molecules).
Post Reply