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

fix: Use model.schedule only when it is not None #2050

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

rht
Copy link
Contributor

@rht rht commented Feb 22, 2024

This fixes the error that shows up in projectmesa/mesa-examples#79 and projectmesa/mesa-examples#99,

        agent_records = map(
            get_reports,
>           model.schedule.agents if hasattr(model, "schedule") else model.agents,
        )
E       AttributeError: 'NoneType' object has no attribute 'agents'

Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
Schelling small 🔵 +0.2% [-0.3%, +0.6%] 🔵 -0.8% [-0.9%, -0.6%]
Schelling large 🔵 +12.0% [-18.3%, +54.7%] 🔵 -2.3% [-4.3%, -0.2%]
WolfSheep small 🔵 +1.2% [+0.6%, +1.8%] 🔵 -0.7% [-0.9%, -0.5%]
WolfSheep large 🔵 +16.8% [-0.1%, +40.7%] 🔵 +0.1% [-1.2%, +1.8%]
BoidFlockers small 🔵 +0.4% [-0.4%, +1.0%] 🔵 +0.2% [-0.5%, +1.0%]
BoidFlockers large 🔵 -0.1% [-0.8%, +0.5%] 🔵 -0.8% [-1.2%, -0.3%]

Copy link
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good!

@rht rht merged commit 4bf4b52 into projectmesa:main Feb 22, 2024
13 checks passed
@rht rht deleted the fix_agentset branch February 22, 2024 11:48
@EwoutH EwoutH added the bug Release notes label label Feb 22, 2024
quaquel pushed a commit to quaquel/mesa that referenced this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Release notes label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants