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

Replace GeoSir scheduler with AgentSet functionality #209

Closed
EwoutH opened this issue Sep 25, 2024 · 3 comments · Fixed by #210
Closed

Replace GeoSir scheduler with AgentSet functionality #209

EwoutH opened this issue Sep 25, 2024 · 3 comments · Fixed by #210

Comments

@EwoutH
Copy link
Member

EwoutH commented Sep 25, 2024

Currently the GeoSir model has interesting scheduling behavior, where it looks like the Agents are added multiple times to a base schedulers, with all Agents first being added, and then their neighbours again:

self.schedule = mesa.time.BaseScheduler(self)

self.schedule.add(this_person)
# Add the neighbourhood agents to schedule AFTER person agents,
# to allow them to update their color by using BaseScheduler
for agent in neighbourhood_agents:
self.schedule.add(agent)

self.schedule.step()

The schedulers are deprecated (see projectmesa/mesa#2306), so we would like to replace the BaseScheduler with AgentSet.do() operations (as of the Migration guide).

@glicerico, if I'm correct you originally wrote this model. Could you explain exactly what's happening? And would you be interested in updating the example?

@glicerico
Copy link

@EwoutH i highly doubt I wrote this model, unless my memory has totally forgotten it, hehe... but I also don't appear in the list of contributors.

@EwoutH
Copy link
Member Author

EwoutH commented Sep 25, 2024

Apparently you did :)

@glicerico
Copy link

hahaha seems like it was a mem segfault... :P I used this for a short time only.

So, i doubt I can easily help with migration at this point if I didn't even remember I wrote it, sorry!

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

Successfully merging a pull request may close this issue.

2 participants