Replies: 2 comments 5 replies
-
Yes, agents belonging to multiple spaces is poorly supported at the moment. @wang-boyu has implemented layers for Mesa-geo, maybe there are some learnings from that? Both solutions from @Tortar seem a bit too verbose to me for simple models with only one space, but I am not sure if there is an easy way to prevent that. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Another solution can be to have a dict inside each instance grid where you have the id of the agent as key and as value the position in that instance. This is simple and effective I think. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As of now the pos variable of an agent can become buggy when in a simulation more than one grid instance is used, e.g. an agent belonging to two different networks or an agent belonging to a grid and a network.
We could solve this by:
step 1: Identify each instance of a class in space.py with a name variable provided by the user, making it clear it should be uniquely defined between all instances of the space classes created. So we need to add a name parameter to each class instance;
step 2: assign when the agent is placed on the grid a position like agent.{id_instance_grid}+_pos.
This is a (big) breaking change, but I think a good one. This could be added to #1511.
Beta Was this translation helpful? Give feedback.
All reactions