fix: Add rng parameter to BankReservesModel #317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #316
This PR adds the missing
rngparameter toBankReservesModel.__init__()to make it compatible withmesa.batch_run().Changes
rng=Noneparameter toBankReservesModel.__init__()rngtosuper().__init__(rng=rng)for proper RNG initializationTesting
batch_run.pyexecutes successfully without errorssolara run app.py)Context
This completes the Mesa 3.x migration for bank_reserves that was started in #267, which updated the visualization but missed the RNG parameter update.
Since bank_reserves is currently the only example with a batch_run.py file, this fix is particularly important for demonstrating Mesa's batch_run functionality to users.
Code Changes
Before
After
Related
bank_reserves#267 (Mesa 3.x migration)