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

updated boid_flockers to include direction #2696

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

Conversation

sanika-n
Copy link
Contributor

I updated boid_flockers so that the direction of movement of agents is shown in the simulation.
I did this by changing the marker to caret-down (a triangle with a larger base so that the direction of motion is not ambiguous) and then rotating the marker according to the direction of motion of the agent. Here are some images of boid_flockers after this update:
image

image

Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +2.8% [+1.6%, +4.0%] 🔵 -0.7% [-0.9%, -0.6%]
BoltzmannWealth large 🔵 +0.1% [-0.4%, +0.5%] 🔵 -0.3% [-1.3%, +0.6%]
Schelling small 🔵 +0.2% [+0.0%, +0.4%] 🟢 -4.0% [-4.1%, -3.9%]
Schelling large 🔵 +0.3% [-0.2%, +0.8%] 🔵 -2.7% [-3.4%, -2.0%]
WolfSheep small 🔵 +0.2% [-0.1%, +0.5%] 🔵 -0.0% [-0.2%, +0.2%]
WolfSheep large 🔵 -0.5% [-1.3%, +0.1%] 🔵 +0.3% [-0.6%, +1.4%]
BoidFlockers small 🔵 +0.8% [+0.3%, +1.3%] 🔵 +0.4% [+0.3%, +0.6%]
BoidFlockers large 🔵 +0.7% [+0.3%, +1.0%] 🔵 +0.7% [+0.4%, +1.0%]

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.

Awesome, this is really useful. Code itself looks good!

Why don't the non-blocking boids have an direction?

Have you any idea on the performance impact?

@EwoutH EwoutH requested a review from Sahil-Chhoker February 22, 2025 09:46
@EwoutH EwoutH added enhancement Release notes label visualisation labels Feb 22, 2025
@Sahil-Chhoker
Copy link
Collaborator

Really sorry @EwoutH @sanika-n, as much as I would love to review this PR, my exams got me all tied up for about next 10 days.

@EwoutH
Copy link
Member

EwoutH commented Feb 22, 2025

No worries, it’s all voluntarily. Thanks for communicating your availability clearly, I can pick this one up.

@EwoutH
Copy link
Member

EwoutH commented Feb 23, 2025

@sanika-n a simple initial test is running the old model for 1000 steps and (manually) timing how long it takes, and then doing the same for the updated model. Make sure to use the same seed in both cases.

@sanika-n
Copy link
Contributor Author

Awesome, this is really useful. Code itself looks good!

Why don't the non-blocking boids have an direction?

Have you any idea on the performance impact?

Just added the direction element to all the boids, and these are the timings that I got after updating the non-flocking boids

Random seed 42

Altered version
1000 steps: 11min 44sec
50 steps: 15.84s
25 steps: 8.18s

Original version
1000 steps: 5min 22s
50 steps: 10.33s
25 steps: 5.42s

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

Successfully merging this pull request may close these issues.

3 participants