Why is an attribute being set to “0”?
Posted: Fri Mar 31, 2023 8:41 pm
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.
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.