**An Agent-Based Model to Simulate the Spread of a Virus Based on Social Behavior and Containment Measures †**

### **Manuel Seijas Carpente \*,‡, Bertha Guijarro-Berdiñas ‡ , Amparo Alonso-Betanzos ‡, Alejandro Rodríguez-Arias ‡ and Adina Dimitru ‡**

University of A Coruña, CITIC, Campus de Elviña, s/n, 15071 A Coruña, Spain; berta.guijarro@udc.es (B.G.-B.); amparo.alonso@udc.es (A.A.-B.); alejandro.rodríguez.arias@udc.es (A.R.-A.); adina.dumitru@udc.es (A.D.)

**\*** Correspondence: manuel.seijas@udc.es; Tel.: +34-655-29-96-27

† Presented at the 3rd XoveTIC Conference, A Coruña, Spain, 8–9 October 2020.

‡ These authors contributed equally to this work.

Published: 20 August 2020

**Abstract:** COVID-19 has brought a new normality in society. However, to avoid the situation, the virus must be stopped. There are several ways in which the governments of the world have taken action, from small measures like general cleaning up to large-scale measures like confinement. In this work, we present an agent-based tool that allows for simulating the virus expansion as a function of these containment measures and the Social Behavior based on people needs, beliefs, and social relations. Once this tool has been validated, it will be useful to evaluate the impact of future containment measures so that the most balanced ones can be found for the effectiveness of the measures and their good reception by the population.

**Keywords:** intelligent software agents; agent-based modeling; artificial intelligence; NetLogo; COVID-19; epidemiological model

#### **1. Introduction**

The impact of COVID-19 on society has generated important changes in it. Countries have been forced to take different control measures with different responses and results in their inhabitants. In this situation, it becomes mandatory to answer questions like: How will people's behavior change in the face of the measures taken? How will the rate of spread of the virus change depending on people's behavior?

Taking all these questions into consideration, we want to reach a solution that benefits both the well-being of society (including its satisfaction and needs) as well as the containment of the virus and danger. To achieve the proposed solution, it is important to be able to simulate all kinds of situations in which not only the preventive measures and actions in which governments agree to reduce expansion are taken into account, but also the variables of social satisfaction, as well as social needs.

#### **2. The Agent-Based Model**

In this section of the paper, we will talk about the project itself, its phases, results, and conclusions.

#### *2.1. Phase 1: Virus Spread Model*

In the first phase, the objective was to introduce a basic model into the system that would allow for simulating the spread of the virus in humans, taking into account exclusively their social relationships (friends, family, close people, etc.). None of the containment measures are taken into account at this

stage. To carry this out, we chose the SIR epidemiological model [1], which represents with almost total precision the real situation. However, this model needs certain adjustments, to add social relations between individuals, as follows:


These rules may seem a little trivial, but they must be defined to create something akin to a real environment in which the virus spreads.

As a development tool, we use NetLogo, a multi-agent programmable modeling environment. We provide the user with an interface in which this network is defined with a color code: green individuals simulate people who may be infected (they are not but can be infected by others), red individuals simulate infected people, and blue individuals simulate cure/dead people (in this phase, it is not necessary to know the difference). Individuals can change between states; a green individual can turn red if infected, a red can turn blue if he cures, and so on.

#### *2.2. Phase 2: Modeling Human Behavior*

When governments have faced the problem of containing the COVID-19 contagion, in almost all cases, regulations have been issued that involve sudden changes in people's habits. Even if these rules are dictated to change a situation for the better and for the general benefit of society, they affect people's lives differently. Based on sociological and psychological research, we endowed agents with certain behaviors that make them react differently to the same norms. To do this, we use the HUMAT model [2] in which agents behave according to values (like environmental care), social needs (like feeling accepted by a group), and experiential needs (like the need to go for a walk or earn money). These needs, and how they are satisfied, can cause dilemmas or cognitive dissonance in agents (for example, an agent's values force him to obey the rules, but he has an urgent need to go outside). Finally, the strength of these cognitive dissonances is what will cause the agent to break government-mandated rules or even try to convince others to break them.

#### *2.3. Phase 3: Data Gathering*

The next step was to collect information about people's thoughts and feelings about possible virus containment measures in Spain. In addition to this, we collected data on their way of life and their possibilities in different situations, to name a few:


All of this data, and more, is useful for generating simulations in which the artificial human society can take certain actions or decisions that would lead the same society to different results in the spread of the virus (for example, people who tend to skip rules because they are living an uncomfortable situation are more likely to massively spread contagions).

#### *2.4. Phase 4: Near Future Work, Applying the Data to the Sir Model*

The last step will be to use the gathered data to improve the virus expansion model. In this phase, our individuals will be able to make decisions and take actions on their social network, such as breaking rules or making other people break them as well.

Historical data and survey data will help us to reconstruct the lived situation and simulate others in which a a community succeeds or fails to follow social norms and stop contagions.

With all of this information, the system will be updated into a AI System where the information will lead the virus in its expansion, obtaining different results. These results can be measured and interpreted, searching for the best strategy to follow on a situation like the one of the simulation.

#### **3. Conclusions**

An agent-based model has been developed that includes a classical model of virus expansion that is further modified thanks to the ability of the system to simulate the behavior of a society with respect to certain norms. This system will be adapted to the COVID situation by using data gathered from surveys on April 2020 and by including the political norms the the Spanish Government implemented to stop contagions. Such an agent-based simulation of a case will help explain what social dynamics played a role and how critical actions and needs of people affected these dynamics. In this way, we can learn the conditions under which better or worse scenarios could have been more probable and help to find a balance between the effectiveness of the measures and their good reception by the population.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


c 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/).
