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

examples/gol: Add initial fraction alive, add sliders to viz #2489

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

EwoutH
Copy link
Member

@EwoutH EwoutH commented Nov 11, 2024

Improve the Game of Life examples:

  • Add a initial_fraction_alive keyword argument for the how many cells are alive at the start
  • Add sliders for width, height and the initial fraction alive.

image

- Add a initial_fraction_alive keyword argument for the how many cells are alive at the start
- Add sliders for width, height and the initial fraction alive.
@EwoutH EwoutH added the example Changes the examples or adds to them. label Nov 11, 2024
Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +0.0% [-0.3%, +0.4%] 🔵 +0.3% [+0.1%, +0.4%]
BoltzmannWealth large 🔵 -0.4% [-0.9%, +0.2%] 🔵 -0.2% [-0.7%, +0.2%]
Schelling small 🔵 -0.4% [-0.6%, -0.2%] 🔵 +0.0% [-0.1%, +0.2%]
Schelling large 🔵 -0.9% [-1.0%, -0.7%] 🔵 -0.6% [-1.0%, -0.1%]
WolfSheep small 🔵 -0.5% [-0.7%, -0.2%] 🔵 -0.6% [-0.8%, -0.5%]
WolfSheep large 🔵 -0.3% [-0.7%, +0.2%] 🔵 +0.4% [-0.8%, +1.7%]
BoidFlockers small 🔵 -0.7% [-1.2%, -0.2%] 🔵 -0.2% [-1.1%, +0.7%]
BoidFlockers large 🔵 +0.5% [-0.1%, +1.1%] 🔵 +0.9% [+0.2%, +1.5%]

@quaquel
Copy link
Member

quaquel commented Nov 11, 2024

I would also add the seed (here and it all example models)

    "seed": {
        "type": "InputText",
        "value": 42,
        "label": "Random Seed",
    },

@EwoutH
Copy link
Member Author

EwoutH commented Nov 11, 2024

Agree, but let's do that in a separate model for all models at once.

Maybe we can even add it pragmatically in SolaraViz for every visualisation. If "seed" is not specified in model_params, add your dict entry automatically at the end of the dict.

@quaquel
Copy link
Member

quaquel commented Nov 11, 2024

Maybe we can even add it pragmatically in SolaraViz for every visualisation. If "seed" is not specified in model_params, add your dict entry automatically at the end of the dict.

I looked into that when we decided to collapse the seed into the model arguments, and it's not easy to do allways. For now, let's just add it to all examples and I am fine with doing it via a separate PR.

@EwoutH EwoutH merged commit b550244 into projectmesa:main Nov 11, 2024
11 of 13 checks passed
EwoutH added a commit that referenced this pull request Nov 11, 2024
- Add a initial_fraction_alive keyword argument for the how many cells are alive at the start
- Add sliders for width, height and the initial fraction alive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Changes the examples or adds to them.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants