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

add agents property to all spaces #2418

Merged
merged 8 commits into from
Oct 25, 2024
Merged

Conversation

quaquel
Copy link
Member

@quaquel quaquel commented Oct 25, 2024

This adds an agents property to all spaces which returns an AgentSet containing the agents in the space. See #2416 for background discussion

TODO

  • tests

@quaquel quaquel added feature Release notes label 2 - WIP labels Oct 25, 2024
@quaquel quaquel linked an issue Oct 25, 2024 that may be closed by this pull request
mesa/space.py Show resolved Hide resolved
Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 -1.3% [-3.8%, +1.3%] 🔵 -0.1% [-0.2%, +0.0%]
BoltzmannWealth large 🔵 +0.1% [-0.8%, +1.0%] 🔵 +1.5% [-0.3%, +3.1%]
Schelling small 🔵 -0.2% [-0.7%, +0.3%] 🔵 +0.2% [-0.1%, +0.5%]
Schelling large 🔵 +0.0% [-1.8%, +2.1%] 🔵 +3.1% [-2.2%, +8.2%]
WolfSheep small 🔵 +0.0% [-0.7%, +0.6%] 🔵 +0.9% [+0.5%, +1.2%]
WolfSheep large 🔵 -1.0% [-2.2%, +0.3%] 🔵 +0.0% [-4.3%, +4.1%]
BoidFlockers small 🔵 +1.6% [+0.5%, +2.8%] 🔵 +1.0% [+0.2%, +1.7%]
BoidFlockers large 🔵 +1.9% [+1.3%, +2.5%] 🔵 +0.9% [+0.3%, +1.6%]

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.

Looks good, thanks!

@quaquel quaquel removed the 2 - WIP label Oct 25, 2024
@quaquel quaquel merged commit e40075d into projectmesa:main Oct 25, 2024
10 of 12 checks passed
@quaquel quaquel deleted the agents_property branch October 25, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Release notes label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a common interface to all spaces for getting agents
2 participants