A Particle-Based COVID-19 Simulator With Contact Tracing and Testing

Goal: The COVID-19 pandemic has emerged as the most severe public health crisis in over a century. As of January 2021, there are more than 100 million cases and 2.1 million deaths. For informed decision making, reliable statistical data and capable simulation tools are needed. Our goal is to develop an epidemic simulator that can model the effects of random population testing and contact tracing. Methods: Our simulator models individuals as particles with the position, velocity, and epidemic status states on a 2D map and runs an SEIR epidemic model with contact tracing and testing modules. The simulator is available on GitHub under the MIT license. Results: The results show that the synergistic use of contact tracing and massive testing is effective in suppressing the epidemic (the number of deaths was reduced by 72%). Conclusions: The Particle-based COVID-19 simulator enables the modeling of intervention measures, random testing, and contact tracing, for epidemic mitigation and suppression.


I. TRANSITIONS BETWEEN EPIDEMIC STATES
In this simulator, particles move on a 2D map as shown in Fig. 1.The vector ∈ R stores the epidemic states of all particles, where each element contains the epidemic status of the particle , 1 ≤ ≤ , and has one of these values based on the epidemic status: 0 -Susceptible, 1 -Exposed, 2 -Infected, 3 -Recovered, 4 -Dead, 5 -True Quarantined, 6 -True Isolated, 7 -Severely Infected, 8 -False Isolated, and 9 -False Quarantined.Transitions between epidemic states are shown in Fig. 2. The parameters of the model are given in Table I.
At the beginning of the simulation, all particles are in the Susceptible state ( = 0 for = 1,..., ).Then, we randomly choose particles and change their epidemic status to the Exposed ( = 1, for = 1,..., , where ∈ R is a vector of pseudorandom integers drawn from the discrete uniform distribution on the interval [1, ]).Then, all particles start moving on the map and come into contact with each other.
A susceptible particle becomes exposed when it comes into contact with a contagious particle (i.e., Exposed, Infected, True Quarantined, True Isolated, or Severely Infected).A contact between two particles is assumed to happen when the distance between them is less than ℎ .In order to find the contacted susceptible particles, first, we need to identify contagious particles in the epidemic state vector .Thus, we define ∈ R that contains the indices of contagious particles, where = 1 for the contagious particle, otherwise = 0. Similarly, we define vectors that contain indices of the Susceptible ( ∈ R ), Exposed ( ∈ R ), Infected ( ∈ R ), True Quarantined ( ∈ R ), True Isolated ( ∈ R ), and Severely Infected particles ( ∈ R ).The is calculated based on the disease transmission probabilities as where ∈ R is a vector of uniformly distributed random numbers in the range [0, 1], is a pointwise multiplication operator and | is a logical OR operator.
Then, we identify the current positions of contagious particles on the map as where is a number of non-zero elements in , ∈ R 2 is a matrix that stores the current positions of all particles.Then, we employ the rangesearch( , , ℎ ) function [1] of MATLAB to create a vector ∈ R that stores indices of particles that were in contact with the contagious particles.This way, we can extract the indices of the contacted susceptible particles from as Then, we change their epidemic state to Exposed and reset their epidemic time in the susceptible state: The exposed particles whose epidemic time in this state exceeds the exposure period move to the Infected state, and their epidemic time is set to zero as Some portion of the infected particles are selected randomly and moved to the Severely Infected state during their infection period , and regarded as positively-tested (i.e., hospitalized) where ∈ R is a vector of uniformly distributed random numbers in the range [0, 1]; ∈ R stores for each particle the date when its COVID-19 test result was positive, and is the current date.
Then, the infected particles move to the Recovered state after days: Severely infected particles die with probability after days while the rest move to the Recovered state: The testing module randomly tests particles in the Susceptible, Exposed, and Infected states that were not tested before.The results of the tests might be true positive or false positive because of the test sensitivity and specificity : where is the current date.
Particles that were correctly detected by the test are moved to the True Quarantined and True Isolated states as Susceptible particles that were incorrectly tested positive move to the False Isolated state: Then, the contact tracing module checks the contacts of the positive tested particles.The contacts of the exposed particles transition to the True Quarantined state, while the contacts of the Infected particles move to the True Isolated state.Similarly, the contacts of the Susceptible particles, which were incorrectly detected by the test, are sent to the False Quarantined state.
Particles in the True Quarantined state transition to the True Isolated when their epidemic time exceeds the exposure period : On the other hand, particles in the False Quarantined state return to the Susceptible state when the exposure period ends: Some portion of the particles in the True Isolated state are selected randomly and moved to the Severely Infected state during their infection period : The other particles in the True Isolated state recover after days: On the other hand, particles in the False Isolated state go back to the Susceptible state when the infection period ends: II. IMPACT OF THE PARTICLE VELOCITY ON THE SPREAD OF THE EPIDEMIC The velocity of the particles plays an important role in the spread of the epidemic among the population.Higher values of lead to a faster spread of the disease.In order to show this, we conducted simulations with different values of = {0.5, 0.75, 1.0, 1.25, 1.5}.The total number of particles is 10,000, and the initial number of exposed particles is 10.The other parameters of the simulation are shown in Table II.For each considered maximum velocity , we ran 10 simulations and took averaged results.The averaged results for all cases are summarized in Fig. 3.According to the results, the epidemic reaches the peak faster with the increased speed of particles.In addition, the number of exposed and infected particles at the peak also grows with increased velocity.As a result, the numbers of severely infected, recovered, and dead particles increase faster.The results show that a higher velocity results in a higher number of contacts per unit time.Therefore, we changed the value of , according to the epidemic timeline, to imitate different levels of the quarantine in Lecco.

III. PARTICLE-BASED SEIR SIMULATION THE CANTON OF GENEVA
To validate our particle-based simulator and model for the province of Lecco, we have performed simulations for the canton of Geneva in Switzerland.The official statistics [2] for this country have been shared by its government since February 25, 2020 and a number of seroprevalence studies have been performed.
The canton of Geneva is one of the most heavily hit regions of Switzerland by the COVID-19 epidemic, with 42,159 officially registered cases by January 12, 2021.However, according to the seroprevalence study [3] in the canton of Geneva from April 6 to June 30, 2020, around 7.8% of the population (38,595) had antibodies, which is seven times greater than the officially confirmed cases at that date (5,412).In order to adjust the parameters of the model for Geneva, we relied on the total cases that were corrected using the seroprevalence survey results and officially confirmed number of deaths.The total number of particles was set to 499,480 (the population of the canton) [4].The initial number of exposed particles was set to 10.We started the simulation on January 5, 2020, in accordance with the official statistics [2].To initialize the number of tests per thousand people, we used the averaged value 0.5 from the official statistics [2].We adjusted parameters, such as and while the other parameters were the same as for the province of Lecco.All parameters of the simulation are provided in Table IV.To imitate the lockdown in Geneva, we decreased the maximum speed of particles and , in accordance with the epidemic timeline (see Fig. 4).The detailed timeline of policies in the canton of Geneva is provided in Table III.We used these to adjust parameters and calibrate the model for this specific region.
We ran 10 simulations, and the averaged results are shown in Fig. 4. The results show that by tuning only a few parameters of the calibrated model we can fit data for other countries.The model also predicted the peak of the epidemic accurately, because, according to the official data, the number of cases increased starting from the middle of March and remained high  until the middle of April.In addition, the model predicted the second wave of the epidemic after 180 days.The same can be observed in the official data (see Fig. 5).

Fig. 1 .
Fig. 1.Visualization of the particles on the map including their epidemic states.

Fig. 4 .
Fig. 4. The averaged results of ten simulations for the canton of Geneva.The upper plot shows the states of the epidemic simulation versus time.The dates of important NPIs are shown by vertical dashed lines and listed in TableIII.One standard deviation around the average Total case curve is shaded in blue.The bottom plot compares the average number of deaths in the simulation with the actual number of deaths due to COVID-19.This plot also shows the simulation results for the number of severely infected particles as well.One standard deviation around the average Dead state curve is shaded in grey.

TABLE I .
List of simulation parameters and their descriptions.

TABLE II .
Parameters of the simulation.

TABLE IV .
Simulation Parameters for the canton of Geneva.