Unable to set a temporary attribute
-
- Senior Member
- Posts: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Unable to set a temporary attribute
This is a two-hour puzzle. See News Org action G5_2 Create News Org MMs. The value of Invoker.temp PoliticianID is never set, as seen in the News Orgs results table. This causes many warnings.
Compare this to Voter action G3_1 Create Politician Comparison which also sets a temporary attribute value, in almost the exact same manner.
I’m using lots of temporary variables, since Ventity triggers and actions appear to have no equivalent of passing arguments in a function call. This creates a lot of clutter. Is there a better way? Thanks.
Compare this to Voter action G3_1 Create Politician Comparison which also sets a temporary attribute value, in almost the exact same manner.
I’m using lots of temporary variables, since Ventity triggers and actions appear to have no equivalent of passing arguments in a function call. This creates a lot of clutter. Is there a better way? Thanks.
- Attachments
-
- RDem 97.zip
- (90.2 KiB) Downloaded 466 times
Re: Unable to set a temporary attribute
I think this may have been saved before the invoker attribute surrogate was defined, because for me there's nothing on the action view except a local attribute, "source type". What should the temp ID be set to?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Re: Unable to set a temporary attribute
Thanks. Are we looking at the same diagram? "source type" is nowhere on News Org action G5_2 Create News Org MMs. See the image.
The especially odd thing is temp politician truthfulness IS being set.
The especially odd thing is temp politician truthfulness IS being set.
Re: Unable to set a temporary attribute
Is it a key? You can't change a key.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Re: Unable to set a temporary attribute
No, and it refers to none. It is indeed a puzzle, a head scratcher, and an enigma! I also tried setting it with a shadow variable.
-
- Senior Member
- Posts: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Re: Unable to set a temporary attribute
We have a clue. See the table for Media Meme. Action G5_2 Create News Org MMs calls action G5_3 Create News Org MMs for One Politician, which adds five records to Media Meme, all for the same politician. Only the first has Politician set. The rest are empty. Is it possible that Ventity is somehow losing the value of temp PoliticianID after the first of five calls?
-
- Senior Member
- Posts: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Re: Unable to set a temporary attribute
A small question. What is the logical operator for "or"? The one for and is "&&".
Re: Unable to set a temporary attribute
or = ||
Generally boolean syntax is c-like: &&, II, !=, == but we permit a single = and <> too.
Generally boolean syntax is c-like: &&, II, !=, == but we permit a single = and <> too.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Unable to set a temporary attribute
Problem could be that you're using surrogates where you need references. Rule of thumb should be, if you're not changing an attribute, use a reference. Easiest way to change it is to edit the downstream equation, change the bullet to a dot, then use the right click method to add the referenced var, and delete the surrogate from the model.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Unable to set a temporary attribute
Another thing I notice is that there's an undeleted parent surrogate that's not on the diagram (probably inadvertent use of delete key).
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Re: Unable to set a temporary attribute
Thanks once again. I appreciate your style, showing and explaining the problems you find, rather than solving the problem. That maximizes learning!
I noticed you had shadow variables and my version of the model didn't. First I deleted two undeleted items. This made almost no difference, still got about 170 warnings. Then I started changing attributes to shadows. On G5_3 Create News Org MMs for One Politician, changing Invoker (large dot) temp politicianID to little dot with a shadow eliminated all warnings. Wow.
If use of a non-shadow causes the framework to misbehave, it seems to me it would be extremely helpful to say so in the warnings. Instead, all it says is "Unable to reference Entity Type [politician] from belief_meme [belief_meme[belief_meme_0108]] using Attribute [Politician]". This problem happens much later than what this action is doing. Thanks!
I noticed you had shadow variables and my version of the model didn't. First I deleted two undeleted items. This made almost no difference, still got about 170 warnings. Then I started changing attributes to shadows. On G5_3 Create News Org MMs for One Politician, changing Invoker (large dot) temp politicianID to little dot with a shadow eliminated all warnings. Wow.
If use of a non-shadow causes the framework to misbehave, it seems to me it would be extremely helpful to say so in the warnings. Instead, all it says is "Unable to reference Entity Type [politician] from belief_meme [belief_meme[belief_meme_0108]] using Attribute [Politician]". This problem happens much later than what this action is doing. Thanks!
Re: Unable to set a temporary attribute
I'm not sure if the change in notation is causing fewer warnings because of some property of surrogate vs. reference, or because the result is fewer undefined reference attributes around, but I'll look into it.
I think the underlying problem is that the interface steers you to use of surrogates where references would be more appropriate. I've ticketed this for an improvement.
I think the underlying problem is that the interface steers you to use of surrogates where references would be more appropriate. I've ticketed this for an improvement.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/