Comments (8)
Thanks for reporting, Not sure why I used idx_id
at all, but the Rtree should be able to use the unique_id of the agents. I'll do the necessary changes
from mesa-geo.
I'm not sure this solution will work in every case, because the unique_id of an agent can be anything, while rtree expects a long integer.
In my case my agents have a string as a unique id, which is loaded from a geojson file.
from mesa-geo.
Ah, that was probably the reason in the first place! Thanks for letting me know. I actually should have tested my own solution, but my local set-up broke and I haven't found the time to fix it.
If you have a suggestion please feel free to tell me or submit a PR. Setting idx_id
as an agent attribute as originally implemented would of course work, but am not sure if is such a good idea (and if probably only as a private attribute _idx_id
from mesa-geo.
Ah, probably id(agent)
should be sufficient as an index integer, no?!
from mesa-geo.
Yes I agree.
I took a look at id(agent)
and the documentation says This is an integer (or long integer) which is guaranteed to be unique and constant for this object during its lifetime
which fits quite well with the use in mesa-geo.
I also like it more than setting an _idx_id
as a side-effect.
from mesa-geo.
Ok I tried using id(agent)
. Could you please test it? I am still not able to run my own project atm 😜
from mesa-geo.
It took me a while to get back to this, but I tested it today and it seems to work well for me. Thanks for the changes!
from mesa-geo.
Hah! I just remembered this issue today and wasn't sure if I ever fixed it. But glad I did and it worked ;)
Thanks for coming back to this.
from mesa-geo.
Related Issues (20)
- Missing ModularVisualization in rainfall example? HOT 14
- Add citation information about Mesa-Geo
- Implement simpler Mesa-Geo namespace HOT 1
- v0.4.0 release HOT 3
- Improving `RasterLayer` HOT 4
- Add test for python 3.11
- Move mesa-geo examples into mesa-examples repo HOT 6
- ci: Replace flake8 with Ruff HOT 1
- cookiecutter for mesa-geo
- Uncaught ReferenceError in examples HOT 4
- automatically adjusting/zoomable map?
- v0.5.0 release HOT 1
- Update for Mesa v2.1 HOT 1
- frontend: python frontend for Mesa-Geo HOT 20
- tutorial for the geoschelling model (points & polygons)
- `GeoSpace.agents_at()` method doesn't work
- Some examples don't work in version 0.6.0 HOT 2
- Fix "undefined" in charts HOT 3
- ci: run on all pushes and PRs, publish to PyPI on tags
- Control widgets disappear when zooming into rainfall demo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mesa-geo.