From b6220465f0b08aede1d216ef4953454665586bd6 Mon Sep 17 00:00:00 2001 From: rht Date: Thu, 22 Feb 2024 06:07:28 -0500 Subject: [PATCH] fix: Use model.schedule only when it is not None --- mesa/datacollection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesa/datacollection.py b/mesa/datacollection.py index 3fcd205c9c5..f5f6ead235b 100644 --- a/mesa/datacollection.py +++ b/mesa/datacollection.py @@ -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