Skip to content

Use scenario for all examples in benchmarks#3314

Merged
quaquel merged 5 commits intomesa:mainfrom
codebreaker32:use_scenario
Feb 16, 2026
Merged

Use scenario for all examples in benchmarks#3314
quaquel merged 5 commits intomesa:mainfrom
codebreaker32:use_scenario

Conversation

@codebreaker32
Copy link
Copy Markdown
Collaborator

This PR refactors the core examples used in the global performance benchmarks to utilize the Scenario.

Changes Made

  • Updated the Schelling, BoidFlockers, and WolfSheep models to accept a Scenario object upon initialization rather than individual parameters.
  • Implemented specific scenario classes (e.g., SchellingScenario, BoidsScenario) for each model.
  • Modified global_benchmarks.py to dynamically unpack configuration parameters into Scenario objects during the run.

Fixes #3307

@EwoutH
Copy link
Copy Markdown
Member

EwoutH commented Feb 15, 2026

Thanks for the PR.

As described (on a weird location) in our examples Readme, we make a distinction between basic and advanced examples:

The examples are categorized into two groups:

  1. Basic Examples - Simpler models that use only stable Mesa features; ideal for beginners
  2. Advanced Examples - More complex models that demonstrate additional concepts and may use some experimental features

Since Scenario is still an experimental feature, it's too soon to update the basic examples. So ideally we would update the benchmark script to be able to handle them.

@quaquel
Copy link
Copy Markdown
Member

quaquel commented Feb 15, 2026

In #3307, I suggested fixing it in this way. The main reason for this is that in Mesa 4, we want scenario to become the default anyway, so we'd better start benchmarking it accordingly.

@EwoutH
Copy link
Copy Markdown
Member

EwoutH commented Feb 15, 2026

Sure, we're targeting 4.0.0 now anyways.

Copy link
Copy Markdown
Member

@quaquel quaquel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

benchmarks don't yet run, see my suggested/suspected fix.

@codebreaker32
Copy link
Copy Markdown
Collaborator Author

codebreaker32 commented Feb 16, 2026

benchmarks don't yet run, see my suggested/suspected fix.

Its expected, because main branch still has broken code. However I am trying to fix the other errors

@codebreaker32
Copy link
Copy Markdown
Collaborator Author

Fixed the configurations.py. Now it is running fine locally

Copy link
Copy Markdown
Member

@quaquel quaquel 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 to me

@quaquel quaquel merged commit 16e7928 into mesa:main Feb 16, 2026
14 checks passed
@codebreaker32 codebreaker32 deleted the use_scenario branch February 16, 2026 08:27
Krishsharma179 pushed a commit to Krishsharma179/mesa that referenced this pull request Feb 21, 2026
* Initial Commit

* Update benchmarks/global_benchmark.py

Co-authored-by: Jan Kwakkel <[email protected]>

* Fix configurations

* Add test coverage

---------

Co-authored-by: Jan Kwakkel <[email protected]>
@quaquel quaquel added ci Release notes label enhancement Release notes label labels Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Release notes label enhancement Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken BoltzmannWealth in benchmarks

3 participants