From 4466e2d6f364161e7e668441cfa58c6fd749097a Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 23 Aug 2024 07:51:34 -0400 Subject: [PATCH] make_model: Set seed after model initialization This is because the seed param is no longer always passed by the user to mesa.Model.__init__. --- mesa/visualization/solara_viz.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mesa/visualization/solara_viz.py b/mesa/visualization/solara_viz.py index 6ec33231cae..cae0cc67e77 100644 --- a/mesa/visualization/solara_viz.py +++ b/mesa/visualization/solara_viz.py @@ -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