# SIM-D: An Agent-Based Simulator for Modeling Contagion in Population

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Disease Model Parameters

## 3. Related Work

#### 3.1. Deterministic Models or Compartment Models

#### 3.2. Agent-Based Stochastic Models

## 4. The SIM-D Algorithm

Algorithm 1: The general SIM-D algorithm, where P represents a Person, ${I}_{ij}$ refers to an interaction between Person i and j and $P{T}_{ij}$ refers to the outcome of their interaction. N refers to the total number of simulation time-steps and K refers to the total number of persons. |

- Each person determines the list of persons that it is going to interact with based on a normative schedule, and individual behaviour and health state.
- The persons compute interactions with other persons. The computation uses disease transmissibility, person susceptibility and duration of contact. The interaction may or may not result in an infection, depending on a stochastic model. Disease propagation from one person to another person is modelled by Equation (1).$${P}_{ij}=1-{e}^{1-rst}$$
- If a person gets infected, it is notified of the infection.
- At the end of time-step, the persons with outcomes update their state. The number of infections at locations are also updated.

## 5. Implementation

- Prepare Interactions—The person objects calculate the interactions that it has to perform with other persons. The interactions are computed based on the input interaction graph, its status (infected or susceptible), its vaccination status and isolation criteria.
- Send Interactions—The person objects send the calculate interactions to intended person objects.
- Compute Interactions—The person objects compute one-to-one interactions between itself and received messages. The probability of infection is calculated using Equation (1).
- Send Outcomes—If an interaction results in an infection, a message is sent to the relevant person object with the outcome of the interaction.
- The person objects and location objects update their status according to the outcome of interactions.

## 6. Evaluation

#### 6.1. Experimental Setup

#### 6.2. SIR Infection Diffusion in Population

#### 6.3. SIS Infection Diffusion in Population

#### 6.4. Effects of Transmissibility

#### 6.5. Effects of Interventions

^{th}iteration, when the lockdown was eased (40% of outside the house interactions were allowed).

## 7. Limitations of SIM-D

- The current version does not cover the seasonal mutations as it happens in different diseases. For example, if we want to simulate the seasonal flu influenza, we can do it using the SIS model given the known parameters (transmissibility, incubation period, infectious period). However, if we want to simulate flu influenza across the seasons, it will not be possible with the current simulation as the virus may mutate and its disease parameters (transmissibility, incubation period, infectious period) may change.
- It is a serial algorithm. Therefore, the number of agents (persons) that SIM-D could simulate are limited (to thousands) at this point.
- Currently, we have Equation 1 that applies to a certain class of diseases. To cover a larger number of diseases, SIM-D has to incorporate more equations.
- In its current form, the model is not directly applicable to other contagions such as habits, fear etc.
- SIM-D is not capable of simulating two diseases at the same time.
- Currently, we are using age, home location, state, and interaction list as a person’s demographics. Interaction list is used for computing interactions with other individuals. Age, home location and state are used for the filtering of simulation output. For example, what are the total number of infections in a particular area or what age group is most affected. The current version of SIM-D does not perform any analysis on these statistics.
- SIM-D does not model pharmaceutical interventions and it would be a good value addition in future.

## 8. Conclusions and Future Works

## Author Contributions

## Funding

## Conflicts of Interest

## Abbreviations

WHO | World Health Organization |

SEIR | Susceptible Exposed Infectious Recovered |

SIR | Susceptible Infectious Recovered |

SIS | Susceptible Infectious Susceptible |

SI | Susceptible Infectious |

FSM | Finite State Machine |

STEM | Spatiotemporal Epidemiological Modeler |

OOP | Object-Oriented Programming |

## References

- Wang, C.; Pan, R.; Wan, X.; Tan, Y.; Xu, L.; Ho, C.S.; Ho, R.C. Immediate psychological responses and associated factors during the initial stage of the 2019 coronavirus disease (COVID-19) epidemic among the general population in China. Int. J. Environ. Res. Public Health
**2020**, 17, 1729. [Google Scholar] [CrossRef] [Green Version] - Alexandre, D.; El Ayadi, A.; Sidibe, S.; Delvaux, T.; Camara, B.; Sandouno, S.D.; Beavogui, A.; Rutherford, G.; Okumura, J.; Zhang, W.H.; et al. Effect of Ebola virus disease on maternal and child health services in Guinea: A retrospective observational cohort study. Lancet Glob. Health
**2017**, 448–457. [Google Scholar] [CrossRef] [Green Version] - WHO. A World at Risk: Annual Report on Global Preparedness for Health Emergencies. Available online: https://www.preventionweb.net/publications/view/67706 (accessed on 25 March 2020).
- WHO. Worldometer. Available online: https://www.worldometers.info/coronavirus/ (accessed on 2 April 2020).
- Chakraborty, I.; Maity, P. COVID-19 Outbreak: Migration, Effects on Society, Global Environment and Prevention. Sci. Total Environ.
**2020**, 728, 138882. [Google Scholar] [CrossRef] - Alvarez, F.E.; Argente, D.; Lippi, F. A Simple Planning Problem for COVID-19 Lockdown. 2020. Available online: https://ideas.repec.org/p/nbr/nberwo/26981.html (accessed on 27 March 2020).
- Contreras, G.W. Getting ready for the next pandemic COVID-19: Why we need to be more prepared and less scared. J. Emerg. Manag. (Weston Mass.)
**2020**, 18, 87–89. [Google Scholar] [CrossRef] - Chowell, G.; Sattenspiel, L.; Bansal, S.; Viboud, C. Mathematical models to characterize early epidemic growth: A Review. Phys. Life Rev.
**2016**, 66–97. [Google Scholar] [CrossRef] [Green Version] - Sharkey, K.J. Deterministic Epidemiological Models at the Individual Level. J. Math. Biol.
**2008**, 57, 311–331. [Google Scholar] [CrossRef] [Green Version] - Garner, M.; Hamilton, S. Principles of epidemiological modelling. Rev. Sci. Tech. (Int. Off. Epizoot.)
**2011**, 30, 407–416. [Google Scholar] [CrossRef] [PubMed] - Barrett, C.; Bisset, K.; Eubank, S.; Feng, X.; Marathe, M. EpiSimdemics: An efficient algorithm for simulating the spread of infectious disease over large realistic social networks. In Proceedings of the 2008 ACM/IEEE Conference on Supercomputing SC ’08, Austin, TX, USA, 15–21 November 2008; pp. 1–12. [Google Scholar] [CrossRef]
- Bisset, K.R.; Aji, A.M.; Bohm, E.; Kale, L.V.; Kamal, T.; Marathe, M.V.; Yeom, J. Simulating the Spread of Infectious Disease over Large Realistic Social Networks Using Charm++. In Proceedings of the 2012 IEEE 26th International Parallel and Distributed Processing Symposium Workshops PhD Forum, Shanghai, China, 21–25 May 2012; pp. 507–518. [Google Scholar]
- Eubank, S. Scalable, efficient epidemiological simulation. In Proceedings of the 2002 ACM Symposium on Applied Computing; Association for Computing Machinery: New York, NY, USA, 2002; pp. 139–145. [Google Scholar] [CrossRef] [Green Version]
- d’Alché Buc, F.; Schachter, V. Modeling and simulation of biological networks. In Proceedings of the International Symposium on Applied Stochastic Models and Data Analysis, Brest, France, 17–20 May 2005. [Google Scholar]
- Cauldwell, A.V.; Long, J.S.; Moncorgé, O.; Barclay, W.S. Viral determinants of influenza A virus host range. J. Gen. Virol.
**2014**, 95, 1193–1210. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Veljkovic, V.; Veljkovic, N.; Muller, C.P.; Müller, S.; Glisic, S.; Perovic, V.; Köhler, H. Characterization of conserved properties of hemagglutinin of H5N1 and human influenza viruses: Possible consequences for therapy and infection control. BMC Struct. Biol.
**2009**, 9, 21. [Google Scholar] [CrossRef] [Green Version] - Johnson, T.; McQuarrie, B. Mathematical modeling of diseases: Susceptible-infected-recovered (sir) model. In Proceedings of the Math 4901 Senior Seminar, University of Minnesota, Morris, MN, USA, 12 January 2009. [Google Scholar]
- Laubenbacher, R. Modeling and Simulation of Biological Networks; American Mathematical Soc.: Providence, RI, USA, 2007; Volume 64. [Google Scholar]
- Bisset, K.; Chen, J.; Feng, X.; Kumar, S.; Marathe, M. EpiFast: A fast algorithm for large scale realistic epidemic simulations on distributed memory systems. In Proceedings of the International Conference on Supercomputing; Association for Computing Machinery: New York, NY, USA, 2009; pp. 430–439. [Google Scholar] [CrossRef]
- Reluga, T.; Medlock, J.; Perelson, A. Backward Bifurcations and Multiple Equilibria in Epidemic Models with Structured Immunity. J. Theor. Biol.
**2008**, 252, 155–165. [Google Scholar] [CrossRef] [Green Version] - Keeling, M.J.; Rohani, P. Modeling Infectious Diseases in Humans and Animals; Princeton University Press: Princeton, NJ, USA, 2008; Available online: https://www.jstor.org/stable/j.ctvcm4gk0 (accessed on 4 April 2020).
- Thieme, H. Persistence under Relaxed Point-Dissipativity (with Application to an Endemic Model). SIAM J. Math. Anal.
**1993**, 24, 407–435. [Google Scholar] [CrossRef] - Institute of Medicine. Modeling Community Containment for Pandemic Influenza: A Letter Report; The National Academies Press: Washington, DC, USA, 2006; Available online: https://www.nap.edu/catalog/11800/modeling-community-containment-for-pandemic-influenza-a-letter-report (accessed on 9 April 2020).
- Riley, S. Large-Scale Spatial-Transmission Models of Infectious Disease. Science (N. Y.)
**2007**, 316, 1298–1301. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Ferguson, N.; Keeling, M.; Edmunds, W.; Gani, R.; Grenfell, B.; Anderson, R.; Leach, S. Planning for Smallpox Outbreaks. Nature
**2003**, 425, 681–685. [Google Scholar] [CrossRef] - Posny, D.; Wang, J. Computing the basic reproductive numbers for epidemiological models in nonhomogeneous environments. Appl. Math. Comput.
**2014**, 242, 473–490. [Google Scholar] [CrossRef] - Courtejoie, N.; Zanella, G.; Durand, B. Bluetongue transmission and control in Europe: A systematic review of compartmental mathematical models. Prev. Vet. Med.
**2018**, 156, 113–125. [Google Scholar] [CrossRef] [PubMed] - Ballesteros, A.; Blasco, A.; Gutierrez-Sagredo, I. Hamiltonian Structure of Compartmental Epidemiological Models. arXiv
**2020**, arXiv:2006.00564. [Google Scholar] - Eubank, S.; Guclu, H.; Kumar, S.; Marathe, M.; Srinivasan, A.; Toroczkai, Z.; Wang, N. Modeling Disease Outbreaks in Realistic Urban Social Networks. Nature
**2004**, 429, 180–184. [Google Scholar] [CrossRef] - Kwok, K.; Tang, A.; Wei, V.W.I.; Park, W.; Yeoh, E.; Riley, S. Epidemic Models of Contact Tracing: Systematic Review of Transmission Studies of Severe Acute Respiratory Syndrome and Middle East Respiratory Syndrome. Comput. Struct. Biotechnol. J.
**2019**, 17, 186–194. [Google Scholar] [CrossRef] - Jenness, S.; Goodreau, S.; Morris, M. EpiModel: An R Package for Mathematical Modeling of Infectious Disease over Networks. J. Stat. Softw.
**2018**, 84, 1–47. [Google Scholar] [CrossRef] [Green Version] - Hunter, E.; Mac Namee, B.; Kelleher, J. A Taxonomy for Agent-Based Models in Human Infectious Disease Epidemiology. J. Artif. Soc. Soc. Simul.
**2017**, 20, 1–2. [Google Scholar] [CrossRef] [Green Version] - Mniszewski, S.; Del Valle, S.; Stroud, P.; Riese, J.; Sydoriak, S. EpiSimS simulation of a multi-component strategy for pandemic influenza. In Proceedings of the 2008 Spring Simulation Multiconference, SpringSim 2008, Ottawa, ON, Canada, 14–17 April 2008; pp. 556–563. [Google Scholar] [CrossRef]
- Bhatele, A.; Yeom, J.; Jain, N.; Kuhlman, C.J.; Livnat, Y.; Bisset, K.R.; Kale, L.V.; Marathe, M.V. Massively Parallel Simulations of Spread of Infectious Diseases over Realistic Social Networks. In Proceedings of the 2017 17th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGRID), Madrid, Spain, 14–17 May 2017; pp. 689–694. [Google Scholar] [CrossRef]
- Cliff, O.M.; Harding, N.; Piraveenan, M.; Erten, E.Y.; Gambhir, M.; Prokopenko, M. Investigating spatiotemporal dynamics and synchrony of influenza epidemics in Australia: An agent-based modelling approach. Simul. Model. Pract. Theory
**2018**, 87, 412–431. [Google Scholar] [CrossRef] [Green Version] - Longini, I.; Nizam, A.; Xu, S.; Ungchusak, K.; Hanshaoworakul, W.; Cummings, D.; Halloran, M. Containing Pandemic Influenza at the Source. Science (N. Y.)
**2005**, 309, 1083–1087. [Google Scholar] [CrossRef] [PubMed] [Green Version] - GLEAMviz Simulator. Available online: Gleamviz:http://www.gleamviz.org/simulator/GLEAMviz_client_manual_v6.8.pdf (accessed on 3 February 2020).
- Rodrigues, H.S.; Monteiro, M.T.T.; Torres, D.F. Vaccination models and optimal control strategies to dengue. Math. Biosci.
**2014**, 247, 1–12. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Lana, R.M.; Carneiro, T.G.; Honório, N.A.; Codeco, C.T. Seasonal and nonseasonal dynamics of Aedes aegypti in Rio de Janeiro, Brazil: Fitting mathematical models to trap data. Acta Trop.
**2014**, 129, 25–32. [Google Scholar] [CrossRef] - Medeiros, L.; Castilho, C.; Braga, C.; Souza, W.; Regis, L.; Monteiro, A. Modeling the Dynamic Transmission of Dengue Fever: Investigating Disease Persistence. PLoS Negl. Trop. Dis.
**2011**, 5, e942. [Google Scholar] [CrossRef] - Edlund, S.B.; Davis, M.A.; Kaufman, J.H. The Spatiotemporal Epidemiological Modeler. In Proceedings of the 1st ACM International Health Informatics Symposium; Association for Computing Machinery: New York, NY, USA, 2010; pp. 817–820. [Google Scholar] [CrossRef]
- Hladish, T.; Melamud, E.; Barrera, L.; Galvani, A.; Meyers, L. EpiFire: An open source C++ library and application for contact network epidemiology. BMC Bioinform.
**2012**, 13, 76. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Fox, S.J.; Miller, J.C.; Meyers, L.A. Seasonality in risk of pandemic influenza emergence. PLoS Comput. Biol.
**2017**, 13. [Google Scholar] [CrossRef] [Green Version] - Farrukh, M.J.; Ming, L.C.; Zaidi, S.T.; Khan, T. Barriers and strategies to improve influenza vaccination in Pakistan. J. Infect. Public Health
**2017**, 10, 881–883. [Google Scholar] [CrossRef] - Nisar, N.; Badar, N.; Aamir, U.B.; Yaqoob, A.; Tripathy, J.P.; Laxmeshwar, C.; Munir, F.; Zaidi, S.S.Z. Seasonality of influenza and its association with meteorological parameters in two cities of Pakistan: A time series analysis. PLOS ONE
**2019**, 14, e0219376. [Google Scholar] [CrossRef] [PubMed] [Green Version]

**Figure 1.**The four states of a basic Susceptible-Exposed-Infectious-Recovered (SEIR) disease model. ($\Delta {t}_{E}$), ($\Delta {t}_{I}$), and ($\Delta {t}_{R}$) show the dwell times in exposed, infectious, and recovered states, respectively. The model can be used to describe (SIR), susceptible-infectious-susceptible (SIS) and susceptible-infectious (SI) disease models.

**Figure 2.**A simple disease model that shows the progression of disease within an agent. Ovals represent disease states, while the lines represent the transition between states. The labels on lines show the probabilities of transitions.

**Figure 3.**A simple population network graph. The vertices represent persons and the edges show interactions between them. The weights on vertices show the demographics of the individuals.

**Figure 4.**The SIM-D simulator flowchart. The Manager reads population network files and assigns population network to Persons, and disease parameters to Disease State. The Persons interact with other persons and update its status when interaction has outcome. The persons also update locations when outcome is calculated.

**Figure 5.**Five steps of a simulation day. (

**a**) A person compute interactions for the day. (

**b**) A person sends interactions to other interacting persons. (

**c**) Person performs interaction between received requests. (

**d**) Person send outcomes to sending person if infection happens (

**e**) Persons and locations updates their status.

**Figure 6.**Modeling of SIR using SIM-D. The number of people in different states varies as the simulation progresses through steps.

**Figure 7.**Modeling of SIS using SIM-D. The number of people in different states vary as the simulation progresses through steps.

**Figure 8.**SIM-D showing the effect of transmissibility on the number of total infections. At very small values of transmissibility (0.0001), the attack rate is 10%. At transmissibility of 0.0008, the attack rate is 33%. At transmissibility of 0.002, the attack rate is 40%.

**Figure 9.**Effect of interventions on the spread of disease. In no intervention case, the attack rate is 35%. In the isolation case, the attack rate is 18%. In the vaccination case, the attack rate is 13%.

Disease State | Math Term | Typical Influenza Range (Days) |
---|---|---|

Exposed | $\Delta {t}_{E}$ | 1–2 |

Infectious | $\Delta {t}_{I}$ | 3–7 |

Recovered | $\Delta {t}_{R}$ | ${\infty}^{1}$ |

**Table 2.**Shows the dwell times in different disease states for SIR, SIS and SI disease models [21].

Model | $\mathit{\Delta}{\mathit{t}}_{\mathit{E}}$ | $\mathit{\Delta}{\mathit{t}}_{\mathit{I}}$ | $\mathit{\Delta}{\mathit{t}}_{\mathit{R}}$ |
---|---|---|---|

SIR | 0–∞ | 0–∞ | ∞ |

SIS | 0–∞ | 0–∞ | 0 |

SI | 0–∞ | ${\infty}^{1}$ | N/A |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Waleed, M.; Um, T.-W.; Kamal, T.; Khan, A.; Zahid, Z.U.
SIM-D: An Agent-Based Simulator for Modeling Contagion in Population. *Appl. Sci.* **2020**, *10*, 7745.
https://doi.org/10.3390/app10217745

**AMA Style**

Waleed M, Um T-W, Kamal T, Khan A, Zahid ZU.
SIM-D: An Agent-Based Simulator for Modeling Contagion in Population. *Applied Sciences*. 2020; 10(21):7745.
https://doi.org/10.3390/app10217745

**Chicago/Turabian Style**

Waleed, Muhammad, Tai-Won Um, Tariq Kamal, Aftab Khan, and Zaka Ullah Zahid.
2020. "SIM-D: An Agent-Based Simulator for Modeling Contagion in Population" *Applied Sciences* 10, no. 21: 7745.
https://doi.org/10.3390/app10217745