Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add super call to Model and remove self.schedule #2334

Merged
merged 2 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading