A dynamic microsimulation model for epidemics. (December 2021)