This is an open-access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in JMIRx Med, is properly cited. The complete bibliographic information, a link to the original publication on https://med.jmirx.org/, as well as this copyright and license information must be included.

The COVID-19 outbreak, an event of global concern, has provided scientists the opportunity to use mathematical modeling to run simulations and test theories about the pandemic.

The aim of this study was to propose a full-scale individual-based model of the COVID-19 outbreak in Lombardy, Italy, to test various scenarios pertaining to the pandemic and achieve novel performance metrics.

The model was designed to simulate all 10 million inhabitants of Lombardy person by person via a simple agent-based approach using a commercial computer. In order to obtain performance data, a collision detection model was developed to enable cluster nodes in small cells that can be processed fully in parallel. Within this collision detection model, an epidemic model based mostly on experimental findings about COVID-19 was developed.

The model was used to explain the behavior of the COVID-19 outbreak in Lombardy. Different parameters were used to simulate various scenarios relating to social distancing and lockdown. According to the model, these simple actions were enough to control the virus. The model also explained the decline in cases in the spring and simulated a hypothetical vaccination scenario, confirming, for example, the herd immunity threshold computed in previous works.

The model made it possible to test the impact of people’s daily actions (eg, maintaining social distance) on the epidemic and to investigate interactions among agents within a social network. It also provided insight on the impact of a hypothetical vaccine.

The first case of COVID-19 was detected in China [

To solve these problems, the latest advances in computer science and engineering, as well as the COVID-19 outbreak itself, have led to the use of agent-based models for simulating small community epidemic behaviors since in agent-scale simulations. The parameters, all of which involve the individual, are usually experimentally constrained and determined. Previous work by Gharakhanlou and Hooshangi [

The aim of this study was to present a qualitative, full-scale agent-based model with the ability to reproduce the COVID-19 dynamics of Lombardy, Italy, modeling its outbreak and decline in cases, including as much real and open-access data as possible. Lombardy’s population of 10.06 million makes this model very large scale compared to previous works. Secondarily, the study aimed to investigate several alternative scenarios in order to assess their impact at the time. Finally, a social interaction model, used in epidemiological simulations, was employed, per graph theory [

The key objective was to create a 3-layer model (

The 3-layer structure of the model. The first layer, environment and agents, represents the motion of the inhabitants. The second layer represents social interaction between people in terms of collision detection. The third layer represents the virus dynamic in terms of epidemic behavior. S: susceptible, I: infected, R: recovered, D: deceased.

A collision detection algorithm was built within the agent-based model to detect whether 2 particles have a distance less than a fixed value. However, the large scale reached by the model required an ad hoc algorithm for this purpose; this challenging problem was solved via a square cells algorithm that permits the code to run in parallel (thereby decreasing the computational complexity of the task).

An epidemic model was built within the collision detection model, that is, a susceptible-infected-recovered-deceased (SIRD) model [

The model comprised three different layers:

The environment and agents model allows for the use of real data in agent movement, creating the first difference between the proposed model and ODE-based models [

The collision detection model, via 2-km–sided square cells, allows the code to run in parallel, making it possible to compute the epidemic spread of a population of 10 million people agent by agent.

The agent-based epidemic model, based on the Markovian process [

The agents model simulates the behavior of each inhabitant of Lombardy using the approximation of random walks [^{2} was added

The setting of the simulation is Lombardy, making the environment model a closed 2D box with a boundary shape following Lombardy’s borders. In order to keep the particles inside the region, a bouncing condition was introduced at the border, so that a particle that tries to cross the border bounces backward. This condition is very popular in gas thermodynamics [

Starting with the assumption that the algorithm has been designed to run on a commercial computer in parallel (the one used in the study has AMD 3900X 12-cores and 64 GB of RAM) and within reasonable time (about 20 minutes of calculation for 14 days of simulation), the collision detection algorithm played a central role in the implementation of the algorithm. In order to find all points with a distance less than a constant in a set of ^{2} is generally needed. In our model ^{7}, the complexity order was 10^{14}, which is a large number.

Next, Lombardy was subdivided into a grid, 20 km in dimension. Collision detection was applied to every cell of the grid, and every cell was assigned to a separate parallel job to run the computation in parallel through the cells. This multiscale processing allowed for the speeding up of the code, reducing the RAM used simultaneously in computation, which made possible a simulation with 10 million particles at the same time. This approach neglects all the connections across the borders of the cells, but this is beyond the aims of this study.

The creation of this algorithm was a challenging aspect of this study. The idea was to use matrix optimization in order to speed up the computation. The territory was subdivided into 20-km–long cells, and the cells in every frame were completely independent, with the supposition that, on average, every cell contains ^{2} pairwise distances.

With this scheme, we had to only compute the order of ^{2} distances for each block multiplied by the number of blocks (which is about _{C}=_{c}=

From 0 km to 0.5 km

From 0.5 km to 1 km

From 1 km to 1.5 km

From 1.5 km to 2 km

If, for example, the point _{p}_{c}p_{c}

The epidemic model is an SIRD model [

Susceptible: a node that has not already contracted the disease. It can be become infected with a probability _{I}

Infected: a node that is infected, which can then infect susceptible nodes. After _{D}_{D}

Recovered: a node that has recovered from the disease and cannot contract it or infect susceptible nodes anymore;

Deceased: a node that has died and hence cannot infect other nodes.

The proposed model was compared with a classical SIRD model [

Comparison between data on the outbreak, the proposed model, and a classical susceptible-infected-recovered-deceased (SIRD) model [

All simulations are available in .avi format on GitHub [

The first scenario was the Lombardy outbreak of March 2020 [_{I}_{D}

The fitted parameters have a collision radius of 1 km. This can appear very large compared to the 1-m distance suggested by the World Health Organization [

The results of the simulations can be seen in

COVID-19 outbreak simulation. Top-left: population density. Top-right: log_{10} of the infected percentage per cell. Bottom, from left to right: infected number, recovered number, deceased number, and recovered ratio (recovered/deaths). The solid line is the model simulation, the dotted line is extracted data from the Ministry of Health/Civil Protection Department [

The second scenario was inspired by Chu et al [_{I}

We also performed a lockdown simulation, reducing the daily average kilometers traveled by a node from 43 km to 5 km and reducing the interaction distance from 1 km to 100 m. The results of this simulation can be seen in

Social distancing simulation. Top-left: population density. Top-right: log_{10} of the infected percentage per cell. Bottom, from left to right: infected number, recovered number, deceased number, and recovered ratio (recovered/deaths). The solid line is the model simulation, the dotted line is extracted data from the Ministry of Health/Civil Protection Department [

Lockdown simulation. Top-left: population density. Top-right: log_{10} of the infected percentage per cell. Bottom, from left to right: infected number, recovered number, deceased number, and recovered ratio (recovered/deaths). The solid line is the model simulation, the dotted line is extracted data from the Ministry of Health/Civil Protection Department [

The impact of topology in an epidemic model is a popular topic [

It can be seen that the distribution has an evident left tail (in contrast with the right tail of the Barabási-Albert models [

COVID-19 outbreak simulation connectivity. Top-left: population density. Top-right: log_{10} of the group percentage per cell. Bottom-left: degree distribution of the test group. Bottom-right: daily degree distribution of the test group.

Lockdown simulation connectivity. Top-left: population density. Top-right: log_{10} of the group percentage per cell. Bottom-left: degree distribution of the test group. Bottom-right: daily degree distribution of the test group.

This scenario took into account the period between May 31, 2020, and June 14, 2020. During this period, Italy concluded its lockdown, and the number of active cases was decreasing. For this simulation, the kilometers per day was set arbitrarily to 15 km because of the lack of additional information on mobility during this period. The probability of contracting the contagion was halved to account for social distancing. The radius of interaction and the duration of the disease were tuned to reproduce the experimental data. The value for the radius of interaction was 300 m and disease duration was 5 weeks (

Simulation of a decline in cases. Top-left: population density. Top-right: log_{10} of the infected percentage per cell. Bottom, from left to right: infected number, recovered number, deceased number, and recovered ratio (recovered/deaths). The solid line is the model simulation and the dotted line is extracted data from the Decree of the President of the Council of Ministers [

Using the previous scenario of a decline in cases, we tested the impact of vaccinating 70% of the population, similar to the 62% suggested by Park and Kim [

Simulation of vaccination. Top-left: population density. Top-right: log_{10} of the infected percentage per cell. Bottom, from left to right: infected number, recovered number, deceased number, and recovered ratio.

This model demonstrated the importance of people’s actions in an epidemic setting. Indeed, the behavior of the virus was indicative of our own habits [

The model proposed is more computationally expensive than ODE models, which require the calculation of few differential equations to simulate large populations. In general, such algorithms are also faster than agent-based models. The proposed model, however, allows for the interpretation of complex parameters.

This study has explained the behavior of the COVID-19 outbreak in Lombardy and has validated the herd immunity threshold obtained with different techniques [

This work provides a novel, efficient, and low-demanding (in terms of computational resources) population model. Many features remain to be introduced in the model, like an age-dependent virus model, the ability to introduce an age parameter in the model or a more precise spatial simulation based on big data, and the ability to simulate the habits of the population. In conclusion, future work could be done to increase the number of frames per day, thereby improving the performance of the agents.

Decree of the President of the Council of Ministers

ordinary differential equation

susceptible-infected-recovered

susceptible-infected-recovered-deceased

The author thanks the Department of Mathematics and Informatics of the University of Palermo for its support.

None declared.