Skip to content

Commit

Permalink
add super call to Model and remove self.schedule (#2334)
Browse files Browse the repository at this point in the history
* Update model.py

* test and benchmark fixes
  • Loading branch information
quaquel authored Sep 29, 2024
1 parent df51862 commit afd3959
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion benchmarks/BoltzmannWealth/boltzmann_wealth.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, seed=None, n=100, width=10, height=10):
width: the width of the grid
height: the height of the grid
"""
super().__init__(seed)
super().__init__(seed=seed)
self.num_agents = n
self.grid = mesa.space.MultiGrid(width, height, True)
self.datacollector = mesa.DataCollector(
Expand Down
2 changes: 1 addition & 1 deletion mesa/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def __init__(self, *args: Any, seed: float | None = None, **kwargs: Any) -> None
seed: the seed for the random number generator
kwargs: keyword arguments to pass onto super
"""
super().__init__(*args, **kwargs)
self.running = True
self.schedule = None
self.steps: int = 0

self._setup_agent_registration()
Expand Down
1 change: 0 additions & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def test_model_set_up():
"""Test Model initialization."""
model = Model()
assert model.running is True
assert model.schedule is None
assert model.steps == 0
model.step()
assert model.steps == 1
Expand Down

0 comments on commit afd3959

Please sign in to comment.