Skip to content

Commit

Permalink
fix: Use model.schedule only when it is not None (projectmesa#2050)
Browse files Browse the repository at this point in the history
  • Loading branch information
rht authored and quaquel committed Apr 9, 2024
1 parent f6211ae commit 368d3f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mesa/datacollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ def get_reports(agent):

agent_records = map(
get_reports,
model.schedule.agents if hasattr(model, "schedule") else model.agents,
model.schedule.agents
if hasattr(model, "schedule") and model.schedule is not None
else model.agents,
)
return agent_records

Expand Down

0 comments on commit 368d3f7

Please sign in to comment.