Mixing pools are ~4x (or more) longer than equivalent simulations using CommunityNet - but MixingPools better reflect the input data and desired transmission mechanics.
Options to optimize (thanks to Dan Klein):
- Restricting to infectious and susceptible individuals in compute_transmission could provide a boost. If restricting to infectious agents on the transmission side, the mean could change to a sum divided by len(src).
- Caching: The prototype I shared previously was using AgeGroup, which has caching built in. That's great because I recall the mixing matrices are 20x20... so that's 400 pools! But there are only 20+20 src+dst uids to cache. A better design might do one np.digitize and cache that for the step.
- Update frequency: The AgeGroup class already has caching for the current step, but that might be the place to introduce a larger dt
Mixing pools are ~4x (or more) longer than equivalent simulations using CommunityNet - but MixingPools better reflect the input data and desired transmission mechanics.
Options to optimize (thanks to Dan Klein):