combining referenced stocks within a cohort model

A place for Ventity software questions & answers
Post Reply
m4x
Newbie
Posts: 1
Joined: Tue May 04, 2021 8:13 am
Vensim version: Ventity

combining referenced stocks within a cohort model

Post by m4x »

Dear Ventity Community,

I am still new to SD, and Ventity even more so. Hope, you can help me out. I have a cohort model (each cohort an own entity, each hosting 3 clusters) and 2 problems:

(1) Within 3 different entities each representing a cohort, and within each cohort 3 clusters as cohortID, I model a population possessing a specific amount of wealth in a stock. In yet another entity, I would like to combine the 3 referenced stocks (cohort1.money, cohort2.money, cohort3.money). How would you combine these in one stock without losing the separation by clusters. So far, I have only managed to produce parsing errors...

(2) Within each cohort entity, clusters are ascribed different values for money by initialization. And there is a dynamic to the wealth stock. Now, I want to make it a little more dynamic, e.g. cluster 4 to respond with an adjustable delay to changes of money in cluster 5. I guess, if-statements in the flow are not appropriate here and trigger and action seem to only change strings in a given attribute. How would you proceed?

I have uploaded a simplified version of the model here.

Thanks a lot!
And kind regards
m4x
Attachments
cohort_clusters_working.zip
(157.25 KiB) Downloaded 275 times
tomfid
Administrator
Posts: 3800
Joined: Wed May 24, 2006 4:54 am

Re: combining referenced stocks within a cohort model

Post by tomfid »

1) The normal way to aggregate things would be to use a collection to compute Sum(Money). However, that would require a single generic cohort type with 3 instances, rather than the 3 distinct entitytypes that you're using.

If you really need 3 different entitytypes, rather than one type with 3 instances that might have different parameters, you could combine the money stocks by referencing them in some other entity. Then you could write an equation like Total Money = C1.money + C2.money + ...

Either way, the Total Money variable is conceptually stock-like, but it's not literally a stock - it's an aggregate or auxiliary.

2) Without knowing why c4 responds to c5, I'm not sure I can comment helpfully, but here's an attempt. For one cluster to respond to something in another cluster, it needs a reference to that other cluster. If each cluster relates to just one other, you could use an attribute to identify the "mate" cluster. Then you could write something like,

investment = a*wealth + b*mateCluster.wealth

I would definitely avoid writing things like:

investment = if ( cluster="c4" ) { k*c5.wealth } else { 0 }

because you'll end up with a mess of idiosyncratic equations.

If each cluster potentially responds to multiple others, you need to create a relationship entitytype with key [cluster A, cluster B] to handle the flow of material or information among cohorts.
tomfid
Administrator
Posts: 3800
Joined: Wed May 24, 2006 4:54 am

Re: combining referenced stocks within a cohort model

Post by tomfid »

As a matter of process, it might be more productive to get a single cohort working the way you want it to before adding a lot of relationship complexity.
Post Reply