I've been developing an electric vehicle forecast model in Ventity using the dynamic cohort pattern. I have two entities defined: LGA; and VehicleCohort. LGA represents spatial areas, namely local government areas. VehicleCohort contains information about the age of each cohort, number of registered vehicles by cohort and vehicle range.
I managed to get this working the way I want it, but I have a feeling there is a better way to implement the logic. In particular, the way I increase the Range attribute (actually a stock) in the create cohort action. Is there a more elegant way to implement this? I intend to add more complex logic, but wanted to build on the best foundation possible.
I have attached the model CarsByLGA2.zip for your reference. Thanks.
Dynamic cohorts with stock change
Dynamic cohorts with stock change
- Attachments
-
- CarsByLGA2.zip
- (24.03 KiB) Downloaded 906 times
Re: Dynamic cohorts with stock change
This looks fine to me. The only thing I might do differently is keep the range dynamics in the entity rather than the action. In otherwords, compute "create cohort.change" in the LGA entitytype, and then just reference the value in the action (via parent.change or invoker.change). No difference in the result, but it might be easier to debug.
/*
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: Dynamic cohorts with stock change
Cheers, thanks for the advice!