Skip to content
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

Cell space: Convenient method/practice to deny agents access (or remove cells) #2534

Open
EwoutH opened this issue Dec 5, 2024 · 4 comments

Comments

@EwoutH
Copy link
Member

EwoutH commented Dec 5, 2024

It would be nice if you could create inaccessible parts in the cell space, like having "walls" in your space. Maybe even completely being able to remove cells.

Neighbours e.d. should be updated.

@quaquel
Copy link
Member

quaquel commented Dec 6, 2024

Why would you want to create inaccessible parts? Can you give some examples of phenomena that you would like to model?

A critical design choice of the cell spaces is that the way they are wired up is static and cached. This is, in part, what makes them fast. Having dynamic cell spaces would break that design choice and result in a potentially substantial slowdown.

Moreover, you can easily do something like this using property layers. Add a boolean layer indicating which parts of the space a given agent or agent class can access and use this in your custom movement logic.

There is one use case for dynamic cell spaces, and that is for changing networks. There are quite a few open issues about dynamic networks, and neither the old-style network nor the new-style network supports this.

@EwoutH
Copy link
Member Author

EwoutH commented Dec 6, 2024

Why would you want to create inaccessible parts? Can you give some examples of phenomena that you would like to model?

Basically everything with pathfinding or segregation. Emergency workers finding people in an (unknown) environment, a river dividing an ecoystem, a highway through a neighbourhood, etc.

Ideally you could also deny certain types / groups of agents access.

Not sure on implementation, haven't mapped the solution space yet. But a PropertyLayer could work. Removing cells might also be interesting, since it could even increase performance since there are both less cells and less neighbours to check. You could might be able to create vast sparse spaces this way.

@quaquel
Copy link
Member

quaquel commented Dec 6, 2024

Basically everything with pathfinding or segregation. Emergency workers finding people in an (unknown) environment, a river dividing an ecoystem, a highway through a neighbourhood, etc.

I am not sure I would use a cell space for most of these examples. Moreover, the emergency worker example reflect the knowledge of the agents and should thus be handled via agent state not via the environment itself.

Removing cells might also be interesting, since it could even increase performance since there are both less cells and less neighbours to check. You could might be able to create vast sparse spaces this way.

There is a difference between having a dynamic discrete space (i.e., the environment is dynamic) vs. the case where different agents have different understandings of the environment (and where this understanding might itself be evolving). The former is not possible with the current cell spaces. The later is not supported out of the box by MESA. I also doubt whether we should even support that out of the box because there is a 101 ways that users of mesa migth want to implement this.

@EwoutH
Copy link
Member Author

EwoutH commented Dec 23, 2024

Slightly related:

Basically you dynamically "deny" Sheep to access cells with Wolfs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants