In agent based models, GIS maps are often used as environment spaces. The environment type for such models is then a GIS space. A GIS space environment type enables you to place agents in a geospatial environment defined by a GIS map. With the GIS space type, you can also set and retrieve an agent’s current location, to move the agent with a specified speed from one location to another, execute an action when the agent arrives at a location, animate an agent at its location (no matter whether it is initially static or moving), establish connections among agents based on their locations, and perform other useful services.
The following video shows how to read agents' addresses/coordinates from the database and locate agents in the given points on the GIS map:
How-To video: Placing agents on the GIS map
Using the search menu of the GIS Map shape, you can easily place an agent at a desired location on a GIS map. To do this, you first need to find a desired location, then you assign an agent to the location.
The option Create agents at selected elements is only available if there are custom agent types in the model.
With the following functions, you can programmatically define an agent’s initial location on a GIS map. These functions should be used only to initialize an agent’s location. They should not be used to move an agent.
There are three ways to programmatically define an agent’s initial location:
void setLocation(INode node)
- Puts the agent in the specified location: a GIS point or region.
Parameter: node - name of the location
void setLocation(Point point) - Puts the agent in the specified GIS point.
Parameter: point - name of the location
void setLocation(Agent agent)
- Puts the agent into the location of another
void setLatLon (double latitude, double longitude)
- Sets the coordinates of the agent location.
latitude - the latitude coordinate of the location measured in degrees (-90 ... (South) ... 0 ... (North) ... 90)
longitude - the longitude coordinate of the location measured in degrees (-180 ... (West) ... 0 ... (East) ... 180)
Sample model: Product Delivery