I wanted to implement a feature in a population cohort model where age classes can be monitored (e.g. 0-24, 25-34, etc.). For this reason I referred to the sample model "CohortPop+ageMonitorAlt" and used the construction presented there for "childbearing age". So an attribute "Age range 0 to 24" has been created which should receive the information about the age of the cohort. Together with the action "update age range", this attribute can be used to create a new subcollection (age range 0 to 24). So far it works fine.
However I tried to provide this attribute with several items (age 0 to 24, 25 to 34, etc.). This does not work. One solution would be to create a number of attributes for each age class... but this is not very attractive. Is there a better solution? I also tried to use an auxiliary with an if then else functionality, but here I cannot use/convert double to feed the attribute.
Cohort models age monitoring
Re: Cohort models age monitoring
There isn't a good solution for this yet.
What I've done, for a very limited set of age classes, is to create an "age class" attribute, and use a command action to update it based on the nominal age of the cohort.
However, the "else if" syntax doesn't work for attribute initialization in attributes, so this requires creation of one action per class.
Sorry. We'll get there.
What I've done, for a very limited set of age classes, is to create an "age class" attribute, and use a command action to update it based on the nominal age of the cohort.
However, the "else if" syntax doesn't work for attribute initialization in attributes, so this requires creation of one action per class.
Sorry. We'll get there.
/*
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: Cohort models age monitoring
Thank you. It's good to know where to look for a better solution and where not!
Re: Cohort models age monitoring
Actually, I think we have a solution. I'll post ASAP.
/*
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
*/
-
- Junior Member
- Posts: 5
- Joined: Fri Oct 14, 2016 12:43 am
- Vensim version: Ventity
Re: Cohort models age monitoring
Just added a feature that directly supports grouping attribute values within numeric ranges for a variable or expression. This will be part of Release 1.1, sometime next week.
Re: Cohort models age monitoring
Good. I'm looking forward to this!