Skip to content

Commit

Permalink
make_model: Set seed after model initialization
Browse files Browse the repository at this point in the history
This is because the seed param is no longer always passed by the user to
mesa.Model.__init__.
  • Loading branch information
rht committed Aug 23, 2024
1 parent 9fc2422 commit 4466e2d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mesa/visualization/solara_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@ def SolaraViz(
# 2. Set up Model
def make_model():
"""Create a new model instance with current parameters and seed."""
model = model_class.__new__(
model_class, **model_parameters, seed=reactive_seed.value
)
model.__init__(**model_parameters)
model = model_class(**model_parameters)
model._seed = reactive_seed.value
current_step.value = 0
return model

Expand Down

0 comments on commit 4466e2d

Please sign in to comment.