Skip to content

Add RandomActivationByBreed from Sugarscape example to available schedulers in time.py #900

Closed
@majdal

Description

@majdal

What's the problem this feature will solve?
Sometimes you need to step() each breed of agent separately. The Sugarscape example already has a scheduler that takes care of that use case: RandomActivationByBreed. It makes sense for it to be merged into the schedulers available by default in time.py.

Describe the solution you'd like
Copy RandomActivationByBreed into time.py. The class might require some adjustment to work with the DataCollector class, since the agent_reporters loop over all agents in the schedule, regardless of breed, which will inevitably raise a bunch of AttributeError exceptions.

Alternatively we could subclass the DataCollector class to make it collect by breed.

Additional context
It might be interesting to also have a StagedActivationByBreed scheduler.

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