BDI-pathogens/OpenABM-Covid19

How can I get the history of the simulation?

kirchnergo opened this issue · 1 comments

In the moment you get the interactions and trace tokens for the last day.
Could you please provide a way or example how one can get these information for each step of the simulation, e.g. a similar result with an additional column of the day or step. It would be helpful for evaluation purposes and one could also extract other summaries and time series. Thanks!

This can be done currently via the Python interface, example below (is how I do it) for the trace tokens. The data for each time_step will overwrite the previous file, so you will need to read it in or move it to a different file at each time step.

model.one_time_step()
model.write_trace_tokens()  
df_trace = pd.read_csv("trace_tokens_Run1.csv", comment="#", sep=",", skipinitialspace=True )
model.one_time_step()
model.write_trace_tokens()  
df_trace2 = pd.read_csv("trace_tokens_Run1.csv", comment="#", sep=",", skipinitialspace=True )