Hello,
I am using mesa to build a simple simulation.
I have a simulation and a case where I want to show the number of agents with the health status a,b,c and d, in each step. I want all data in one chart.
For now, I have 4 datacollector instances and 4 charts as I cannot put all together.
My problem is how to connect the mode_reporters with the series in the ChartModule class as I am trying to have one reporter pointing to a function that returns a pack or maybe a list with the values I want.
example code :
model.py
def cumulative_values(self):
some_conditions....
return a, b, c, d #or return [a,b,c,d]
inside model __init__self.
datacollector = DataCollector(
model_reporters={"Cumulatices":
cumulative_values})
visualization_model.pyChartModule([{"Label": "a Agents",
"Color": "#ff0000"},
{"Label": "b Agents",
"Color": "#ff6699"},
{"Label": "c Agents",
"Color": "#33cc33"},
{"Label": "d Agents",
"Color": "black"}],
data_collector_name='datacollector')
I am not understanding how to use the datacollector object with the ChartModel. The documentation/tutorial is not too deep in this matter.
Thanks in advance!