SciCompMod / memilio

Modular spatio-temporal models for epidemic and pandemic simulations
https://scicompmod.github.io/memilio/
Apache License 2.0
52 stars 15 forks source link

Combine functions for real initialization of LCT and IDE model #1020

Open lenaploetzke opened 2 months ago

lenaploetzke commented 2 months ago

The scheme for interpolating real data is the same for the IDE and the LCT model. Maybe we can define a central function that can be used by both initialization functions.

          In both cases you are writing the interpolated values in a vector, irrespective if this is calculated for compartments or flows. The offset is calculated with respect to times and in the calculation you multiply entry.num_confirmed with e.g. (time - floor(time)) and then there is some scaling with scaling factors and some probabilities. So I do think that it is possible to write a generalized interpolation function (for these four if statements) and that it would make sense to write this. I don't think this needs to happen in this PR but it could be another issue.

_Originally posted by @annawendler in https://github.com/SciCompMod/memilio/pull/952#discussion_r1580957068_