Skip to content

Replace GeoSir scheduler with AgentSet functionality #209

@EwoutH

Description

@EwoutH

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions