From a9d8a6a104ab448b0b16a70f450482a4c8b652ce Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Sat, 21 Sep 2024 14:13:19 +0200 Subject: [PATCH] Update pd_grid --- examples/pd_grid/pd_grid/model.py | 6 +----- examples/pd_grid/pd_grid/server.py | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/pd_grid/pd_grid/model.py b/examples/pd_grid/pd_grid/model.py index 1be0d4fc..b1c2a05c 100644 --- a/examples/pd_grid/pd_grid/model.py +++ b/examples/pd_grid/pd_grid/model.py @@ -6,11 +6,7 @@ class PdGrid(mesa.Model): """Model class for iterated, spatial prisoner's dilemma model.""" - schedule_types = { - "Sequential": mesa.time.BaseScheduler, - "Random": mesa.time.RandomActivation, - "Simultaneous": mesa.time.SimultaneousActivation, - } + activation_regimes = ["Sequential", "Random", "Simultaneous"] # This dictionary holds the payoff for this agent, # keyed on: (my_move, other_move) diff --git a/examples/pd_grid/pd_grid/server.py b/examples/pd_grid/pd_grid/server.py index 1709fcce..57785acc 100644 --- a/examples/pd_grid/pd_grid/server.py +++ b/examples/pd_grid/pd_grid/server.py @@ -10,9 +10,9 @@ "height": 50, "width": 50, "activation_order": mesa.visualization.Choice( - "Scheduler type", + "Activation regime", value="Random", - choices=list(PdGrid.schedule_types.keys()), + choices=PdGrid.activation_regimes, ), }