projectmesa / mesa

Mesa is an open-source Python library for agent-based modeling, ideal for simulating complex systems and exploring emergent behaviors.
https://mesa.readthedocs.io
Apache License 2.0
2.55k stars 893 forks source link

[Feature Request] Allow cells to have properties #501

Closed Moody1021 closed 6 days ago

Moody1021 commented 6 years ago

Is it possible to create a space class that will allow cells to have properties? Is there any easy way to do this with a metaclass? Suggestions appreciated. Thanks!

jackiekazil commented 6 years ago

When you say properties, can you be more explicit? I ask, because Python has something called properties and I don't know if you are explicitly asking for that or if you want attributes.

Moody1021 commented 6 years ago

Sorry for the delay in responding. We were traveling for a couple of weeks.

What I am looking for is attributes. In particular, the basic notion in abms is mostly that the background (space) is featureless. The agents have rules / policies / attributes. The kind of modeling that I am doing is expanding that notion a bit. The context can have attributes / features. One of those features is memory, i.e., what has happened in that space. Potentially, this memory may have a time constant over which it degrades.

I have implemented a framework for doing this. Here is what I have so far:

Right now I am trying to get the graphics to work a bit more easily.

At some point, when the code is a bit more polished, I could ship it to you to review to see if you think it would be helpful to add to mesa.

quaquel commented 6 days ago

This is now supported in MESA 3.