-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Collecting data from different types of agents (agenttype_reporters) #2804
Copy link
Copy link
Closed
Labels
bugRelease notes labelRelease notes label
Description
Hi,
I am not sure if I am misunderstanding the usage of agenttype_reporters parameter in DataCollector() function, but I cannot make it work. For example, I was trying to implement it in the Money Model (https://mesa.readthedocs.io/latest/tutorials/2_collecting_data.html) by replacing
self.datacollector = mesa.DataCollector(
model_reporters={"Gini": compute_gini},
agent_reporters={"Wealth": "wealth"}
)with
self.datacollector = mesa.DataCollector(
model_reporters={"Gini": compute_gini},
agenttype_reporters={MoneyAgent: {'Wealth': 'wealth'}}
)In this case no errors are popping up, but at the end there are no Wealth data in the results. Running using batch_run():
params = {"width": 10, "height": 10, "n": range(5, 105, 5)}
results = mesa.batch_run(
MoneyModel,
parameters=params,
iterations=5,
max_steps=100,
number_processes=1,
data_collection_period=-1,
display_progress=True,
)
results_df = pd.DataFrame(results)
Am I missing something? If I use both agent_reporters and agenttype_reporters at the same time, then only measures defined in agent_reporters are saved in the results. Mesa version 3.2.0
Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugRelease notes labelRelease notes label