Skip to content

Commit

Permalink
fix: Use model.schedule.steps -> mode._steps for batch_run
Browse files Browse the repository at this point in the history
  • Loading branch information
rht authored and EwoutH committed Jul 22, 2024
1 parent 6b8146a commit e6d3f3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mesa/batchrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ def _model_run_func(
"""
run_id, iteration, kwargs = run
model = model_cls(**kwargs)
while model.running and model.schedule.steps <= max_steps:
while model.running and model._steps <= max_steps:
model.step()

data = []

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

for step in steps:
model_data, all_agents_data = _collect_data(model, step)
Expand Down

0 comments on commit e6d3f3e

Please sign in to comment.