Why is an attribute being set to “0”?

A place for Ventity software questions & answers
Post Reply
Jack Harich
Senior Member
Posts: 68
Joined: Wed Sep 15, 2004 9:01 pm
Vensim version: DSS

Why is an attribute being set to “0”?

Post by Jack Harich »

Another head-scratching puzzle. Something is setting an attribute to “0”. I can even remove the one place where’s set, and it’s still set to “0”. I’m using an attribute instead of a stock for a boolean 1 or 0, due to the awkwardness and diagram clutter of changing stock values with flows and an input from the stock.

On the Voter entity, the attribute is temp refPol equals politician supported.

I started setting the attribute to “1” or “0”. The first initial value for the attribute was “0”, so the model may have remembered that somewhere. Then I changed the initial value to “x” and started using “false1” and “true1” for settings, in case Ventity was converting “false” to 0 and “true” to 1. Nothing helped.

A clue is in the Equation Listing Control, searching on “temp refPol”. Notice the selected row. It has Expression “0”. But on that action, the attribute is being read, not set.
Equation Listing Control for temp refPol.png
Equation Listing Control for temp refPol.png (55.14 KiB) Viewed 2448 times
RDem 104.zip
(79.88 KiB) Downloaded 168 times
Jack Harich
Senior Member
Posts: 68
Joined: Wed Sep 15, 2004 9:01 pm
Vensim version: DSS

Re: Why is an attribute being set to “0”?

Post by Jack Harich »

Good news. Thinking about this further and lessons learned from previous bugs, I looked for an undeleted atribute for the attribute in question, before I changed it to a shadow. I found it, deleted it, and now the model sets the attribute appropriately. "0" no longer appears in Equation Listing. So thanks for your help earlier, it helped here!
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Why is an attribute being set to “0”?

Post by tomfid »

Great!
Post Reply