imperialCHEPI / healthgps

Global Health Policy Simulation model (Health-GPS)
https://imperialchepi.github.io/healthgps/
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Consider making `context` in `generate_` and `update_risk_factors` const #222

Open jamesturner246 opened 11 months ago

jamesturner246 commented 11 months ago

Right now it is not, and we don't need to write to the RuntimeContext object, only the Population object contained therein.

Requires changing the RF model interface HierarchicalLinearModel (a bad and misleading name -- should think about changing this soon) and derived classes.

alexdewar commented 1 month ago

I've just been having a look at this and while it might be possible, I think it'll be a fair amount of work (there are >50 uses of context.population()).

Whether this is worth the effort or not kind of depends on what your longer-term refactoring plans are. Does pulling the population part out of context make sense?

alexdewar commented 1 month ago

I'm wondering whether it would make sense to split up RuntimeContext into two different data structures: one for the immutable data (model parameters) and the other for mutable data (e.g. the population, maybe even the RNG).

jamesturner246 commented 1 month ago

I'm about to change a whole lot of the context structure shortly, so happy to put this in the backlog for now.