From 2d09cccd5859cb843785812d930d7a05879537f3 Mon Sep 17 00:00:00 2001 From: Jan Kwakkel Date: Sat, 9 Nov 2024 19:57:51 +0100 Subject: [PATCH] update benchmarks to reflect new devs usage --- benchmarks/Schelling/schelling.py | 1 + benchmarks/WolfSheep/wolf_sheep.py | 4 +--- benchmarks/global_benchmark.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/benchmarks/Schelling/schelling.py b/benchmarks/Schelling/schelling.py index f4543cb4312..733003221c5 100644 --- a/benchmarks/Schelling/schelling.py +++ b/benchmarks/Schelling/schelling.py @@ -75,6 +75,7 @@ def __init__( """ super().__init__(seed=seed) self.simulator = simulator + self.simulator.setup() self.happy = 0 self.grid = OrthogonalMooreGrid( diff --git a/benchmarks/WolfSheep/wolf_sheep.py b/benchmarks/WolfSheep/wolf_sheep.py index b3a168a2055..99e44a00f58 100644 --- a/benchmarks/WolfSheep/wolf_sheep.py +++ b/benchmarks/WolfSheep/wolf_sheep.py @@ -166,6 +166,7 @@ def __init__( self.height = height self.width = width self.simulator = simulator + self.simulator.setup() self.initial_sheep = initial_sheep self.initial_wolves = initial_wolves @@ -225,9 +226,6 @@ def step(self): 20, seed=15, ) - - simulator.setup(model) - start_time = time.perf_counter() simulator.run(100) print("Time:", time.perf_counter() - start_time) diff --git a/benchmarks/global_benchmark.py b/benchmarks/global_benchmark.py index 41c2643f88c..e540048a00e 100644 --- a/benchmarks/global_benchmark.py +++ b/benchmarks/global_benchmark.py @@ -35,7 +35,6 @@ def run_model(model_class, seed, parameters): else: simulator = ABMSimulator() model = model_class(simulator=simulator, seed=seed, **parameters) - simulator.setup(model) end_init_start_run = timeit.default_timer()