The effect of isolation — are lockdowns helpful?

Adam Słucki
Tooploox AI

--

We all see that the regulations implemented in many countries due to the COVID-19 pandemic have tremendous effects on the economy. As much as the world seems to be digitized it is still ill prepared for the majority of the population to be locked in their homes. Among many frustrations, it raises the question if staying at home is truly of any help in this situation? But how can we answer this? Well, one approach is to simulate reality to test various scenarios.

In this post we will introduce you to the topic of multiagent based simulations and show you the results of the simulation our team performed here at Tooploox.

How to simulate a complex world

Thinking of simulations, often something extremely realistic comes to mind, like a flight simulation, which wouldn’t be at all useful without a given level of attention to detail. But when we try to simulate phenomena on a larger scale rather than focus on individuals, then simplification is the key.

Let’s look at some examples. Below is a detailed simulation of respiratory droplet dispersion to visualize what happens when someone coughs indoors. You can read about it here: post on www.nytimes.com

Source: www.nytimes.com

This is a simplified simulation where the physical mechanism of a contagion is using the assumption: the closer you get to an infected person the greater the chance you’ll be infected. This allows you to isolate only those variables that are most important to you. It also reduces the required computing power, especially when the intention is to simulate phenomena occurring among large groups of subjects.

So to simplify the complexity related to the epidemic we’ll need:

  • Environment: this is a space where all the action will occur. It also encapsulates assumptions about the real world. In our case, these will be how many persons are infected at the beginning of the simulation, how easy it is to get infected and how eager people are to leave their homes.
  • Agents: autonomous objects reflecting the subject of our study, in this case living persons that can become infected when in contact with the virus.
  • Interactions: the key aspect of the simulation is that we set relatively simple rules of how agents can interact with each other and the environment, and this often leads to an emergence, allowing us to create truly complex systems. A very prominent example of the emergent system is Langton’s ant.

Our simulated community

To perform our simulations we defined multiple environments. One of them was a small district with a single store.

Fragment of the simulated environment.

So in our environment we have 400 agents in total and homes of different sizes that can fit from one to nine agents. Agents are assigned to homes randomly and there are about 130 homes, so we can expect that on average there will be 3 agents in every home — the most common setup in developed countries. Each agent can go to the store for a given amount of time, but there is a limit to the number of agents that can be in the store at the same time. And this limit is what interests us the most — we want to test how it affects the number of infected agents.

The agents can have one of three states: healthy, infected and recovered. They are also somehow intelligent. They try to keep distance from each other and walk inside the store with a specific goal in mind so their moves are not random. We achieved that with a customised variation of the A* algorithm.

The mechanism of contagion is simple. When a healthy agent is in close range to an infected agent, it can catch the virus with a given probability. The closer the distance, the higher the probability. Once the agent is infected it stays contagious for 140 ticks of the simulation and then becomes recovered and immune. It follows the SIR compartmental model of infectious diseases like COVID-19, but in a multi-agent simulation we also have a spatial aspect which makes it more realistic. These are elements of the SIR model:

If you’re interested in the technicalities, we used the MESA framework to build the simulations. We also slightly modified some visual aspects in the original library.

Simplified version of the simulation for demonstration purpose.

Simulation — Does it matter if more people can be in the store at the same time?

In our simulation, agents staying at home can be infected only by family members. The only way of spreading the disease through the whole community is by meeting infected agents at the store. We define two only slightly different scenarios to check how they will affect the percentage of the infected population in 14 days (140 steps of the simulation):

Scenario I: 5 agents are allowed to be in the store at the same time.

Scenario II: 7 agents are allowed to be in the store at the same time.

Single run of the simulation in Scenario I.
Single run of the simulation in Scenario II.

Comparing the results

As we simplify things we must introduce some randomness to our simulations. It alleviates missing details we couldn’t or didn’t want to deal with. To do so we have to run the simulation with each scenario multiple times. We did 15 runs for each scenario and collected the maximum percentage of the infected population in 14 days. Here are the results:

The highest percentage of infected agents in each run in Scenario I and Scenario II.

The mean value of observations for scenario I is 9.93 and for scenario II is 12.07. To check if the difference between the means is not just a result of a random variation, we have to perform a statistical test called Student’s t-test. The test gives a p-value equal 0.0038. This means that if there was really no difference between the mean values obtained in each scenario, such a result, or even more extreme one, would be observed in 3.8 cases (i.e. running simulations 15 times and comparing the means) out of 1000. This is very unlikely. Also, produced p-value is much smaller than a commonly accepted significance level threshold value of 0.05 so we conclude that the difference is statistically significant, i.e. that the effect is real.

Simulation — When is a good time to come out of lockdown?

At this point we are surely all tired of being kept on lockdown and look forward to going on freely with our lives — going out with friends, attending bigger cultural/sports events and traveling. The good news is that we’re seeing a steep decline in the number of new cases in an increasing number of countries. But opening things up too soon might cause a surge in new cases and a second wave of the epidemic.

To find out when is a good moment to open the economy in our simulated environment, we allowed agents to meet in bigger crowds (up to 20 agents in the public space, which is quite crowded for our little environment) and verified the following initial conditions:

Scenario I: public gatherings are allowed when 10% of the population has already recovered.

Scenario II: public gatherings are allowed when 15% of the population has already recovered.

Scenario III: public gatherings are allowed when 20% of the population has already recovered.

Single run of the simulation in Scenario I.
Single run of the simulation in Scenario II.
Single run of the simulation in Scenario III.

Comparing the results

The number of initially infected agents is the same for all scenarios — 3%. We only allowed agents to meet in one public space (no visiting neighbours was allowed). Similarly to the previous use case, we ran the simulation 15 times and calculated the average value of infected agents.

The highest percentage of infected agents in each run in Scenario I, II and III.

What we observe from the simulations is that even a small difference in the initial population of recovered agents causes a significant difference when it comes to the maximum percentage of infected agents. Opening the store for up to 20 agents (and allowing the space to get crowded) with only 10% of recovered agents caused a second wave epidemic with almost a third of the population getting sick.

Conclusion

Simulations show that limitations regarding how many people can enter indoor facilities at the same time make sense and even seemingly slight changes can have a visible impact on the larger scale.

Although a few percentage points may look like nothing, we must remember that nominal values in this case really do matter. Even 1% of a larger population means thousands of people which can be catastrophic considering a shortage of a medical staff and equipment. We’ve seen the effects of the outbreak in Italy, and other countries, like Japan, are struggling too.

In many countries we observe a transition from the “hammer” phase to the “dance” phase, but nobody knows the correct strategy to come out of lockdown while keeping the number of cases under control. The first wave of reopenings in Europe and Asia do not seem to follow a unified path and resembles a trial-and-error process. While everybody is eager to go outside, opening the economy with a small percentage of recovered population and a small percentage of infections may cause a second wave of infection, just as we have observed in the simulated environment.

It’s better to stay safe — to stay at home.

The project was created collectively by Ivona Tautkute, Konrad Czarnota and Adam Słucki.

If you want to read more about AI, check out our site at Tooploox: https://www.tooploox.com/ai

Sources:

  1. Data for input parameters: Vital Surveillances: The Epidemiological Characteristics of an Outbreak of 2019 Novel Coronavirus Diseases (COVID-19) — China, 2020
  2. Old but easy to grasp explanation of multi agent simulations: J. M. Epstein, R. Axtell. Growing Artificial Societies: Social Science From the Bottom Up. The MIT Press, 1996.
  3. More technical article regarding multi agent simulations in epidemiology: Roche B, Guégan JF, Bousquet F. Multi-agent systems in epidemiology: a first step for computational biology in the study of vector-borne disease transmission. BMC Bioinformatics, 2008.

--

--

Adam Słucki
Tooploox AI

PhD candidate with professional experience in diverse AI projects like text recognition on videos, analysis of viewers retention, emotion recognition and more.