-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
I am currently updating my teaching materials to MESA 3. One of my assignments is an evolutionary version of Axelrod's emergence of collaboration. However, this requires removing the entire population of agents at each tick, and creating the next generation. (I know it can also be implemented differently...). At the moment, there is no convenience method for removing all agents from the model. Since model.agents
returns a weakref agentset, doing operations on this won't work. It seems we need a model level method like model.clear_agents()
, which would call agent.remove
on each agent. It needs to run through agent.remove
rather than just rebuild the model._agents datastructures to ensure that agents are also removed from the experimental cell spaces.