Skip to content
1 change: 0 additions & 1 deletion benchmarks/WolfSheep/__init__.py

This file was deleted.

231 changes: 0 additions & 231 deletions benchmarks/WolfSheep/wolf_sheep.py

This file was deleted.

7 changes: 2 additions & 5 deletions benchmarks/configurations.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
"""configurations for benchmarks."""

from BoltzmannWealth.boltzmann_wealth import BoltzmannWealth
from Flocking.flocking import BoidFlockers
from Schelling.schelling import Schelling
from WolfSheep.wolf_sheep import WolfSheep
from mesa.examples import BoidFlockers, BoltzmannWealthModel, Schelling, WolfSheep

configurations = {
# Schelling Model Configurations
BoltzmannWealth: {
BoltzmannWealthModel: {
"small": {
"seeds": 50,
"replications": 5,
Expand Down
15 changes: 8 additions & 7 deletions benchmarks/global_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,22 @@ def run_model(model_class, seed, parameters):
Returns:
startup time and run time
"""
no_simulator = ["BoltzmannWealth"]
uses_simulator = ["WolfSheep"]
start_init = timeit.default_timer()
if model_class.__name__ in no_simulator:
model = model_class(seed=seed, **parameters)
else:
if model_class.__name__ in uses_simulator:
simulator = ABMSimulator()
model = model_class(simulator=simulator, seed=seed, **parameters)
simulator.setup(model)
else:
model = model_class(seed=seed, **parameters)

end_init_start_run = timeit.default_timer()

if model_class.__name__ in no_simulator:
model.run_model(config["steps"])
else:
if model_class.__name__ in uses_simulator:
simulator.run_for(config["steps"])
else:
for _ in range(config["steps"]):
model.step()

end_run = timeit.default_timer()

Expand Down
Loading
Loading