tapios / risk-networks

Code for risk networks: a blend of compartmental models, graphs, data assimilation and semi-supervised learning
Other
2 stars 2 forks source link

End time for Gillespie_simple_contagion is *not* tmax #57

Open glwagner opened 4 years ago

glwagner commented 4 years ago

We specify tmax in the call to Gillespie_simple_contagion:

https://github.com/dburov190/risk-networks/blob/3fb0f3a104cdcc705ef201dd25a0cea80b17332e/epiforecast/kinetic_model_simulator.py#L128

Note, however, that this is not the final time of the simulation. Similar to ContactSimulator, the Gillespie_simple_contagion "overshoots" the end of the interval. In other words, self.time in

https://github.com/dburov190/risk-networks/blob/3fb0f3a104cdcc705ef201dd25a0cea80b17332e/epiforecast/kinetic_model_simulator.py#L130

is not equal to tmax (which I think is assumed in this function).

We need to take this into account when specifying interval-wise simulations. We can probably reuse the same method / algorithm developed for the same purpose in ContactSimulator.