0
votes

I have placed agents of a population (from a database) on a point on the GIS map (following this tutorial: https://www.anylogic.com/resources/educational-videos/how-to-video-placing-agents-on-the-gis-map/). After that, I converted different regions from the GIS map. Now I want that every agent contains a parameter "region" corresponding to the region that it is located in. Does anyone know how to do this?

Edit: The Region is only needed to identify which GIS points are in the same region. So the parameter "region" can be an integer.

1
What do you refer with "region"? Is it the GISRegion? Else the easiest option is to add a parameter, or variable and just set it when the agent gets created.Jaco-Ben Vosloo
Yes, I mean a GISRegion. I set the order location on a GIS point using the "this" function. But what is the function to select its corresponding region?Bart wolker
I have edited the question. I hope it is more clear now.Bart wolker

1 Answers

0
votes

Simplest option is to have a variable of type GISRegion in your agent and then on the on startup code of the agent you simply access the map and do a region search on the map saving the value to the variable

gisRegion = main.map.searchFirstRegion(address);

enter image description here