Function: choose

A place for Ventity software questions & answers
Post Reply
cobleg
Member
Posts: 21
Joined: Wed Oct 06, 2021 6:28 am
Vensim version: Ventity

Function: choose

Post by cobleg »

I am currently developing a household formation model. This contains two actions: creating households dynamically; and reassigning them to a new region. This is intended to model migration flows. At present, the household decision to migrate is based on Gross State Product (GSP) growth. If less than zero, migrate. The region to migrate to is currently determined by "next region" which is similar to the cow movement between pastures in one of the Ventity demonstration/exercise models.

Instead of this way of migrating, I would like households to choose based on the best opportunity, i.e. the region with the highest GSP growth. Can you please advise how I can implement that in Ventity.

I have attached my model to this message for context.
Attachments
Households2.zip
(21.18 KiB) Downloaded 168 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Function: choose

Post by tomfid »

Generically, I'd say the HH decides to migrate, then runs a Process List action to evaluate possible target regions. These are sorted by GSP or some more general measure of attractiveness. You limit processing to one iteration, and the HH changes its location attribute to match the leading candidate.

If they have to create a relationship entity between HH and region, they can trigger a create action to do that. Usually this takes a cascade of two: HH triggers action in region to initiate the move, region triggers back to HH to execute the move. This way the execute action has the HH as the invoker and the region as the parent.
cobleg
Member
Posts: 21
Joined: Wed Oct 06, 2021 6:28 am
Vensim version: Ventity

Re: Function: choose

Post by cobleg »

Thank you very much. I have created a simpler test model that implements your guidance (see attachment). I'm seeking confirmation that this is the best way to implement your guidance. Also, if it is, hopefully will help others. I'd appreciate any other applications that process lists can be used for. It seems powerful albeit somewhat abstract.
Attachments
ProcessList1.zip
Example model
(10.59 KiB) Downloaded 175 times
cobleg
Member
Posts: 21
Joined: Wed Oct 06, 2021 6:28 am
Vensim version: Ventity

Re: Function: choose

Post by cobleg »

Following up on this thread, I have implemented the remainder of the migration model. I have defined three actions:
1. A create action named: Create households.
2. Process List action named: identify the best region. This ranks regions by total output and records the highest-ranking region in the attribute: best region.
3. A command action named: migrate. This updates the household's region attribute and reallocates households located in under-performing regions.

The Household entity type is the parent and invoker of actions 1 and 3. The Regions entity type is the invoker and parent of action 2.

I think I may have implemented this differently to your guidance. Just wondering if you could provide any guidance on whether this is the best way to implement it or if an alternative setup would be better.
Attachments
RegionalMigration2.zip
(17.16 KiB) Downloaded 167 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Function: choose

Post by tomfid »

I think there's an efficiency issue here. Because the 'identify' and 'update' triggers are in the Region entity, they're executing multiple times - i.e. every region is identifying the best region.

I can think of a couple alternatives.

- Move the trigger to a singleton entity like the Model. Putting it in the Region[] collection would be preferable for compartmentalizing things, but I can't remember if that works.

- Don't use an action. Instead, use an aggregate to compute the maximum(output) in the Region[] and then have each Region entity test whether its output matches the max.

- If individual households have distinct utility functions (i.e. distinct criteria for choosing a region), the household could trigger its own process list to make the choice.
Post Reply