GithubHelp home page GithubHelp logo

Comments (8)

Corvince avatar Corvince commented on June 5, 2024

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.

bpmweel avatar bpmweel commented on June 5, 2024

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.

Corvince avatar Corvince commented on June 5, 2024

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.

Corvince avatar Corvince commented on June 5, 2024

Ah, probably id(agent) should be sufficient as an index integer, no?!

from mesa-geo.

bpmweel avatar bpmweel commented on June 5, 2024

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.

Corvince avatar Corvince commented on June 5, 2024

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.

bpmweel avatar bpmweel commented on June 5, 2024

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.

Corvince avatar Corvince commented on June 5, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.