Analysis and Monte Carlo simulations of a model for the spread of infectious diseases in heterogeneous metapopulations