key: cord-0058178-frj8fipf authors: Almechkor, Mohamed; Aachak, Lotfi El; Elouaai, Fatiha; Bouhorma, Mohammed title: Development of a Simulator to Model the Spread of Coronavirus Infection in a Closed Space date: 2020-12-10 journal: Innovations in Smart Cities Applications Volume 4 DOI: 10.1007/978-3-030-66840-2_93 sha: a57a696993824fb9c91e110f99e444a9fc83336d doc_id: 58178 cord_uid: frj8fipf The outbreak of the novel coronavirus COVID-19 and its level of infectiousness, as well as its status as a global pandemic, has led to concerns about the most effective ways to reduce the transmission rate, however predicting the effectiveness of intervention strategies in a pandemic is difficult, hence the importance of simulating and modeling for understanding the spread of the disease. In this work we designed and developed a computer simulator to enable the study of infectious diseases evolutions, the simulator imitates random movements and positions of a given number of citizens in a closed space. It takes into account several parameters: contamination ratio of the disease, contaminated ratio of population, and mask-wearing ratio. We also elaborated some experiments for studying the impact of the contamination ratio over the disease spreading, as a result for a sample of 100 citizens in a closed place, we used a combination of simulations for the aforementioned 3 parameters. The results show that there’s no significant impact of the contamination ratio of the disease over the number of contaminations per each generation, although it has an impact on the propagation speed. As part of the fight against the COVID 1 -19 pandemic, the world has adopted several measures and imposed many restrictions to slow down the spread. By putting societies and economies on hold, we have curtailed the ability of the virus to spread through our communities. These defensive measures helped to limit some of the short-term impacts of the virus. Among its actions, social distancing standards prove to be essentials, limiting social and community contacts and increasing home isolation are embedded within the pandemic COVID-19 preparedness plans of most countries and appear in current WHO 2 recommendations, in condition to plan for a phased transition away from such restrictions in a manner that will enable the sustainable suppression of transmission at a low-level [1] . Social distancing interventions are important as they represent the only type of intervention measure guaranteed to be available against a novel infectious disease in the early phases of a pandemic. The goal of these interventions is to reduce the overall illness attack rate and the consequential excess mortality attributed to the pandemic and to delay and reduce the peak attack rate, reducing pressure on health services and allowing time to distribute and administer antiviral drugs, and possibly suitable vaccines. Since there are no approved vaccines available today [2], we must find ways to live with this pandemic. Before we could reopen public spaces, we need to specify the most effective policies in terms of safety, forasmuch as the results and effectiveness of these measures are not available and cannot be accurately estimated until they are implemented, this causes hesitation to make decisions, because of the high uncertainty towards results, hence the need of virtual simulations that allow policymakers to model the current environment and analyze the interactions between humans. The present work has two aims, First, to provide a predictive and descriptive simulator that can be used to any closed area/region and by any user, allowing them to generate simulations to understand the evolution and the spread of the disease over different scenarios, and evaluate different behaviors of an infectious disease. Second, to run a sample of tests based on this simulator to find out the impact of the contamination ratio parameter. Section 2 provides a review of some related works and comparisons. In Sect. 3, we cover the methodology used. In Sect. 4 we describe the simulator process, the parameters used, and the rationale of choosing them. Section 5 includes a sample of generated scenarios (outcoming from the simulator) based on different inputs parameters to discover the relation between several disease characteristics such as contamination ratio, propagation speed and the number of contaminations occurred per generation. Finally, we concluded by summarizing the most important remarks and outlining future research. Recently several models have been developed in the literature for modeling the infectious diseases spreading, according to our objective and need; we focus especially on agentbased modeling (ABM). Many studies have investigated to implement this model, as the Washington post simulator in [3] , where each individual is represented with a 2D circle with a constant speed, living in a rectangle which represents a small town of 200 people, moving randomly, starting by 1 infectious individual, it detects contaminations occurred over time, and outcomes with a chart representing the sick-healthy-recovered curves change over time. Another implementation of this model (ABM 3 ) by Petrônio Silva team in [4] , a solution that simulates the dynamics of the COVID-19 epidemic and the epidemiological and also economic effects of social distancing interventions, for emulating a closed society living on a shared environment, consisting of agents that represent people, houses, businesses, the government and the healthcare system, each one with specific attributes and behaviors. It's very interactive but on the condition of knowing python. Furthermore, researchers in [5] present two models for the COVID-19 pandemic predicting the impact of universal face mask-wearing upon the spread of the SARS-CoV-2, employing a stochastic dynamic network-based compartmental SEIR (susceptible-exposed-infectious-recovered) approach, and the other employing individual ABM (agent-based modeling) available in [6] , simulation results argue for urgent implementation of universal masking. In this work, we developed an agent-based simulator, that allows users to assign themselves -according to their main goal-parameters that represent the states and the behaviors (such as wearing the mask, population movement speed, contaminated ratio, number of population, contamination ratio) for understanding the infectious disease circulation through the population and compare results in each scenario have been treated. It guarantees more flexibility and ensures more interactivity for general users, and the ability to build new models as per the need for specific users and scientists. In this part, we cover technologies used in the development of the simulator. Angular is a platform and framework for building single-page client applications using HTML and TypeScript. Angular is written in TypeScript. It implements core and optional functionality as a set of TypeScript libraries that you import into your apps [7]. We used the Perlin algorithm in the simulator to generate continue random value for managing entities' movement. Perlin Noise is an extremely powerful algorithm that is used often in procedural content generation. It is especially useful for games and other visual media. The algorithm takes as input a certain number of floating-point parameters (depending on the dimension) and returns a value in a certain range (for Perlin noise, that range is generally said to be between −1.0 and +1.0 [8]. Quad-tree is a hierarchical data structure used for compact representation of 2D images. The quadtree and its variants have been extensively used in such applications as computer vision, computer graphics, robotics, geometric modeling, and geographic information system. Conceptually, a quadtree is generated by dividing an image into quadrants and repeatedly subdividing the quadrants into sub-quadrants until all the pixels in each quadrant have the same value [9] . (in our case 4 the value must be less than 4 people) (Fig. 1) . In models of disease spread, the modeling of social networks and spatial movements is vital for accurately describing transmission and these can be incorporated into ABMs. ABMs are stochastic models, enabling the variability of human behavior to be incorporated into the model to help understand the variability in the likely effectiveness of proposed interventions [10] . Usually used to model the interactions of individuals within a population, allowing a decision-maker to determine how small changes in behavior and interaction may influence population-level outputs. The proposed agent-based model for the spread of infectious disease detects each agent state changes (susceptible or infectious), that depend on his interaction with his neighbors and the probability of infection (transmission-risk, mask-wearing ratio, the density of population). This solution runs simulations to determine the possible scenarios (contaminations occurred) based on several characteristics' analysis token as inputs, namely: -Number of citizens: number of persons in the environment to be simulated. -The ratio of contaminated citizens: the approximate expectation of the percentage of individuals suspected to be infected in the given environment (at least 1 person, which means 0.01 if the total number of citizens is 100). -The ratio of contamination: it's used to describe the probability of a healthy person to become ill when he is encountering an ill member (estimated from contact tracing). • It's important to obtain a realistic estimate ratio to create a useful and realistic simulation model for decision support. • This ratio (also called transmission risk) differs according to several other factors such as social behaviors, population density in the given place, and the contact duration [11] . -The ratio of wearing mask population: the percentage of people wearing masks from the total number of citizens. When running a given simulation, the population is represented by circles of different colors in a screen of (1300px-1300px), reds are infected individuals, greens are healthy, and blues are the ones wearing a mask (Fig. 2) . The simulation is designed to imitate random movements and positions of the given number of citizens, the initial number of contaminated individuals deduced from the contaminated ratio (we should have at least one person infected for running a simulation). Assuming that the disease is extending probabilistically, the simulation takes into account the ratio of contamination, hence whenever a healthy person comes into contact with an infected one, the model sets the status of this person based on the probability of transmission using a random function that generates this status. Besides as the World Health Organization WHO has mentioned in [12], the COVID-19 virus spreads primarily through droplets of saliva or discharge from the nose when an infected person coughs or sneezes, so the model approach considered that if an infected person (the red one) coughs, sneezes, or talks while wearing a medical mask; in this case, he is not able to infect others, because the mask can help protect those around him from infection [13] . Furthermore, whenever a mask-wearing person (the blue one) comes into contact with anybody, he can be infected with infectious ones [13] . The user can pause in due time and download the result of the simulation in a CSV file which represents the contaminations resulting during this time and also 'who acquires infection from whom'. The tool also allows a multi-Simulations option, for displaying a sample of many simulations by exchanging the same parameters belonging to specific intervals for each parameter, and downloading the results in a CSV 4 file that contains all the contaminations for each combination of inputs (Fig. 3) . • Note1: The sample below is not specified just for the case of COVID-19, it describes in general the spreading process of an epidemic disease. • Note2: In the analysis of the results below, we took the notion of the frame (see definition thereafter) instead of the notion of time so that the results would be standardized and independent of the used machine qualifications. i. The frame is a single image displayed by the simulator and represents a part of a larger sequence of images that make up the simulation view. ii. The propagation speed calculated in the sample below is the number of contaminations that happened in a given number of frames iii. The propagation speed (or spread-rate) in a given cell n (in the graphs below) represents the number of contaminations occurred counted from the appearance of generation n until the appearance of generation (n + 1) divided by (Max frames-Min frames) of the generation n. Propagation − speed = Number of contaminations/Frame range. ii. The min-frame of generation is the first frame corresponding to the first contamination that occurred in this generation. iii. The max-frame of generation is the latest frame corresponding to the last contamination that occurred in this generation. Let's see first how the disease progresses from each viewpoint. Considering that each infectious individual infects 2 other persons on average, as the COVID-19 grows exponentially [15] , the spread of the disease will be explosive as may you have seen in the diagram below, the generation perspective represents the transmission rate and its effect on the evolution of the disease through the population, but in the diagram in the right which takes into consideration the time factor, we can see the disease behavior (in time); a generation n can be active (infects elements which will be classified in generation n + 1) even it's still evolving (the generation n -1 still infects element which will be classified in generation n). Different generations may be synchronously active (exp: members from G1 and G2 infecting other elements simultaneously) ( Fig. 4 and Table 1 ). Each simulation proceeds in 30 000 frames. The objective is to analyze contamination-ratio impact over the disease process, from the perspective of the generation. -In each part we are going to analyze the effect of the contamination ratio parameter, so we took all the nested data (with different values of all the parameters) and group it by the contamination ratio factor; The results of the sample show that the number of contaminations in each generation does not depend on the contamination-ratio (Fig. 5 ). • As you may have noticed: whatever the contamination-ratio value is (probability of the transmission of a given disease); the number of contaminated individuals in a given generation Gi remains almost the same (vertical values in a column are almost the same), and when we look at the values horizontally will notice that each time we iterate over generations the numbers of contaminations is divided by 2. Let's see now how the propagation speed proceeds (Fig. 6 ): • The greater the contamination-ratio, the greater the propagation speed is. The probability of an infectious element to infect someone is: P = Rc * P(A) * P(B) = Rc * P(A) * s/p ( 2 ) • The diagram of the propagation speed shows that the speed of propagation accelerates with the contamination ratio which implies that s (the number of susceptible people) decreases quickly, so, the probability that an infectious person has to infect someone is decreasing quickly, as the number of members which are possible to be infected is decreasing. (We can imagine the behavior in the case of high propagation speed is like an infectious person A running for contaminating a susceptible one (if exist); but on his way, this susceptible will get contaminated from another infectious B; as if there is a competition between infectious members to infect others). The built simulator has succeeded in giving us an insight of an otherwise a novel case with a high level of uncertainties, the simulation proved to be a useful tool to be used for understanding new phenomena and model the problem, the insights generated by analyzing the data given by the simulation help us in predicting the behavior of the disease so that we can make the appropriate decisions in a given situation. In the next paper, we intend to improve the simulator by introducing the space as a variable for more flexibility, so that will allow us to model different spaces and large scale of population, also we aim to involve artificial intelligence features for developing a more intelligent model to evaluate accurately the effectiveness of specific behaviors and measures. World Health Organization: covid-19 strategy updates 14 The Washington post COVID-ABS: an agent-based model of COVID-19 epidemic to simulate health and economic effects of social distancing interventions Distributed Quadtree Processing Currie: how simulation modelling can help reduce the impact of COVID-19 Coronavirus disease 2019 (COVID-19): epidemiology, virology, and prevention Acknowledgments. This project is subsidized by the MENFPESRS and the CNRST as part of the program to support scientific and technological research related to "COVID-19" (2020). Also, we acknowledge financial support for this research from CNRST.