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

Move cell movement into a descriptor #2333

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

quaquel
Copy link
Member

@quaquel quaquel commented Sep 28, 2024

This PR is for discussion in relation to #2292. It shows how it might be possible to use composition for cell-related movement by encapsulating all the movement behavior into a descriptor. So instead of having a special Agent.move_to method, you can do Agent.cell = new_cell. You can also use whatever name you want instead of cell.

An additional benefit that I had not realized at first is that it cleans up the API a bit more as well. A user does not have to interact with the Cell class directly. She only needs to assign the Cell instance to whatever attribute is used for the descriptor.

@quaquel quaquel added the trigger-benchmarks Special label that triggers the benchmarking CI label Sep 28, 2024
@quaquel quaquel removed the trigger-benchmarks Special label that triggers the benchmarking CI label Sep 28, 2024

This comment was marked as outdated.

@quaquel quaquel added trigger-benchmarks Special label that triggers the benchmarking CI and removed trigger-benchmarks Special label that triggers the benchmarking CI labels Sep 29, 2024
Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 -1.7% [-2.7%, -0.8%] 🔵 -0.2% [-0.4%, +0.0%]
BoltzmannWealth large 🟢 -3.6% [-4.1%, -3.1%] 🟢 -9.2% [-10.4%, -8.1%]
Schelling small 🔵 -0.2% [-0.7%, +0.3%] 🔵 -2.2% [-2.9%, -1.5%]
Schelling large 🔵 +0.3% [-0.4%, +1.2%] 🟢 -13.7% [-15.5%, -12.2%]
WolfSheep small 🔵 -0.8% [-1.1%, -0.4%] 🔴 +7.9% [+7.4%, +8.4%]
WolfSheep large 🔵 -0.2% [-1.6%, +0.8%] 🔵 -0.1% [-2.4%, +2.5%]
BoidFlockers small 🔵 -0.4% [-1.0%, +0.0%] 🔵 -1.3% [-2.1%, -0.5%]
BoidFlockers large 🔵 -0.6% [-1.2%, -0.1%] 🔵 -2.1% [-2.6%, -1.5%]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant