-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spatial indexing of GeoAgents #104
Comments
Thanks for opening he issue here! Maybe we could add an additional layer in GeoSpace specifically for fast moving objects? As of know there is the AgentLayer which index everything with rtree and then the StaticLayers with rasters, images and geodataframes Line 84 in a3f01ad
Maybe I could add the fast agents as a vector layer and keep track of the movements there I could try to create a small PR with this change if you think it is interesting |
Sounds good! A PR would be great - appreciate your time and effort on this! Just a note on visualization that might be related - mesa-geo/mesa_geo/visualization/modules/MapVisualization.py Lines 76 to 80 in a3f01ad
If you have any questions regarding creating a PR, please feel free to ask. We also have a contributors guide for your reference. |
Sure! and thanks for the heads-up on the layer rendering, this is indeed important to consider. I'll look at the contrib guide and post something here as soon as possible |
Implemented in #179. Closing. |
What's the problem this feature will solve?
Mesa-Geo uses RTree for spatial indexing of GeoAgents. When such indexing is not necessary (e.g., no neighborhood queries are needed), it could be a performance bottleneck, especially if there's a huge number of GeoAgents. See wang-boyu/agents-and-networks-in-python#2.
On the other hand, when indexing is actually needed, it happens only when adding agents:
mesa-geo/mesa_geo/geospace.py
Lines 292 to 308 in a12f735
Whenever agents move and need re-index, users need to manually call
GeoSpace._recreate_rtree()
. For example:mesa-geo/examples/geo_sir/model.py
Line 109 in a12f735
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: