Skip to content

Commit 01477fc

Browse files
committed
fix: Use model.schedule.steps -> mode._steps for batch_run
Addresses projectmesa/mesa-examples#126
1 parent d2348e2 commit 01477fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mesa/batchrunner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ def _model_run_func(
132132
"""
133133
run_id, iteration, kwargs = run
134134
model = model_cls(**kwargs)
135-
while model.running and model.schedule.steps <= max_steps:
135+
while model.running and model._steps <= max_steps:
136136
model.step()
137137

138138
data = []
139139

140-
steps = list(range(0, model.schedule.steps, data_collection_period))
141-
if not steps or steps[-1] != model.schedule.steps - 1:
142-
steps.append(model.schedule.steps - 1)
140+
steps = list(range(0, model._steps, data_collection_period))
141+
if not steps or steps[-1] != model._steps - 1:
142+
steps.append(model._steps - 1)
143143

144144
for step in steps:
145145
model_data, all_agents_data = _collect_data(model, step)

0 commit comments

Comments
 (0)