I am trying to make a GIS region of circular shape with 4 KM as a radius in AnyLogic but couldn't find how to do it. I'm working on a delivery platform for a restaurant, where the restaurant is at the center of a circular delivery area. In the simulation, random customer locations will be generated within this circle, and deliveries will be made to these customers.
Instead, I tried to check the area of the polygon I drew, but I didn't know where to write and execute the double area function (), which was mentioned in the AnyLogic forum. I tried making a shape and checked if I could convert it to the GIS region, but I saw no option. I know AnyLogic will have an alternative method, but I couldn't find it.
Can I make a circular GIS Region? If not, are there any other alternatives?
Please tell me where to write and run the Java codes, like the functions that are mentioned in GIS region AnyLogic
double area(): Returns the area of this region
(I know this is a function of GIS Region, but I didn't know how to use it)
To build a circular region, you can create it with some GIS environment, export it as a shapefile (.shp) and then import this file into the map created in AnyLogic (tip: there is no circumference option in shapefiles, only polygons). Another way is by code.
But you don't want that!
You want to:
Create a GIS Point at the exact location of the center of your the circle
Take advantage of the fact that approximately 1 km is equivalent to 0.0089982311916 degrees (https://gis.stackexchange.com/questions/19760/how-do-i-calculate-the-bounding-box-for-given-a-distance-and-latitude-longitude#19761)
At AnyLogic source block, in the Location of arrival option, use an uniform distribution around the GIS Point (=center of circular region), with +/-0.0089982311916 (= 1 km):
For example, with a block moveTo (destination: Network/GIS node and Node: gisPoint), I did this for pedestrians going to the Corinthians Stadium, in São Paulo, from some point within a 1k radius.