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 support for alpha, linewidths and edgecolors to agent_portrayal #2468

Merged
merged 9 commits into from
Nov 8, 2024

Conversation

quaquel
Copy link
Member

@quaquel quaquel commented Nov 8, 2024

This closes #2341 and adds support for alpha, linewidths and edgecolors as possible values in agent_portrayal. I also did it in such a way that you can either do it at the level of the individual agent or as an overall space_drawing_kwargs argument but get a value error if you do both.

In addition, I updated the tests and solved a few subtle bugs in draw_space related to the match statement.

It would be great to get this in for MESA 3, because the bug is rather subtle due to the complicated class structure in old-style grids.

@quaquel quaquel added bug Release notes label feature Release notes label labels Nov 8, 2024
@quaquel quaquel requested a review from EwoutH November 8, 2024 09:07
Copy link

github-actions bot commented Nov 8, 2024

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 -4.2% [-6.1%, -2.3%] 🔵 -0.5% [-0.7%, -0.4%]
BoltzmannWealth large 🔵 -0.2% [-0.6%, +0.2%] 🔵 -0.6% [-1.2%, -0.0%]
Schelling small 🔵 -2.0% [-2.4%, -1.5%] 🟢 -7.6% [-7.9%, -7.3%]
Schelling large 🔵 -1.3% [-2.3%, -0.0%] 🟢 -11.8% [-13.6%, -9.9%]
WolfSheep small 🔵 -0.8% [-1.0%, -0.6%] 🔵 -2.4% [-2.6%, -2.2%]
WolfSheep large 🔵 +0.1% [-0.5%, +0.8%] 🔵 +1.9% [+0.3%, +3.8%]
BoidFlockers small 🔵 +0.6% [+0.0%, +1.3%] 🔵 -2.4% [-3.1%, -1.8%]
BoidFlockers large 🔵 +1.4% [+0.5%, +2.4%] 🔵 -2.7% [-3.4%, -2.1%]

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, awesome! Maybe copy some of the examples from #2341 to this PR description.

(let's give a bit of time for others to review)

@quaquel quaquel merged commit 60fc1c8 into projectmesa:main Nov 8, 2024
12 checks passed
@quaquel quaquel deleted the linewidth branch November 9, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Release notes label feature Release notes label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants