Skip to main content

How does COVID-19 continue to spread? - A simulation 2.0 (How it was built)

 Unfortunately, the days we are living right now are still bad, or even worse than ever. Millions of people are being killed by this "new virus", as they called it once. COVID-19 is here and will be among us for too long. Some of us thought, incorrectly, 2021 will be the year, we will have vaccines, that's it! No more problems related to COVID-19! Let's start living as before! 

No, no, no! If you still think this way, please stop it right now. By not respecting the known procedures to avoid the COVID-19 infection you will keep the virus spreading chain. Consequently, the virus will kill more people, being them related to you or not. Many apparently healthy humans are having severe "side effects" by getting infected with this virus. Stop thinking the virus provokes just flu and help to stop the spread! Millions of healthcare professionals are giving their lives to help in this war. You are neglecting them and all the people around you! Keep yourself safe! That is the same that keep everyone safe! You are the key to this! You are the star!

Photo by BRUNO EMMANUELLE on Unsplash


As you already know, I did a simulation to fully understand the COVID-19 spreading. My main goal is to try to understand how we still have more infected people day after day, even after all the information and advice available throughout the media. So, I developed my first version of this simulation without the use of any agent-based modelling (ABM) library to help me. Now, I am presenting a new version of it, running smoother than the first one and with an intuitive and interactive user interface. Moreover, I am using the python Mesa library to improve the agent's modelling and UI.
Figure 1 - Simulation 2.0 UI screenshot

The new UI (Figure 1) allows the user to use the sliders to adjust some model parameters, instead of only changing them in the config.yaml file (every time you change a parameter through the UI you must press the reset button the apply the changes). You can also do steps manually, or start the simulation and wait for its result. Bellow the simulation canvas we have  3 charts. The first one shows the daily cumulative values for all agents health status.  The second one shows the daily values for all agents health status. So, here only newly infected or recovered agents are shown. The pie chart shows the final state of the simulation, where we can see the total of recovered, dead, and heathy agents after a complete run.

The new version also brings new features. In addition to the performance and visualisation improvements, I introduced the ability of agents to travel in and out of the simulation, and a vaccination process.

Travelling Agents

This new feature allows the user to choose a percentage of agents departing to other places or arriving in our simulation. This feature is trying to mimic real-life travelling behaviours where people need to get to another city for work or another necessity. The number of arriving and departing agents by day is not always the same. A random value based on the user's input is generated to arriving and departing agents. So, the user inputs the maximum percentage of travelling agents and then, we have a random number of agents arriving in the simulation, and another different random value departing from the simulation.

Vaccination Process

The vaccination process allows simulating the slow vaccination process we have in the real world. Only the still healthy agents are vaccinated, as the recovered ones already have defences. In the config.xml file, you can change the number of days until the immunisation and the efficiency of each dose. The current approach is based on the Pfizer vaccine. Then, we need two shoots separated by 21 days to have a maximum value of immunisation. In each shoot, the agents have their percentage of getting immune based on the scientific proves until now. In this feature, the user chooses the percentage of agents to vaccinate. Everyone is vaccinated, giving the assumption we do not have delays in this process.

Results

The results will be presented in a separate post. I am preparing it. The link will be in this section as soon as I post it

However, this time you can download the simulation and use it yourself. You just need to download this file and run the shortcut after unzipping it. You can also change the config.yaml file. Do not change more files or the simulation can stop running. If you want to see the simulation log files they are at COVID-19 Simulation/logs /mesa_model.log.

Code Repository

GitHub




Comments

Popular posts from this blog

Artificial Intelligence History

As you know, AI today is a widely used tool in every kind of systems. However, how did it start? We had only one inventor or more people had invested in AI? AI is a recent discovery? When it became so powerful and why? Today's post will put you up to date to the Artificial Intelligence History. Alan Turing Well, everything started alongside the Second World War. Sadly, some of the human's biggest discoveries occurred during wars.  In 1943,  Warren McCulloch and Walter Pitts presented an initial mathematical and computer model of the biological neuron [2].  There was 1950 when John Von Neumann and Alan Turing created the technology behind AI.  Turing created the called Bombe machine to decipher messages exchanged between the German forces. That system was the pillar of today's machine learning [1]. Turing was a huge impact in the Artificial Intelligence field, and still today some of his statements are updated and used.  Turing questioned the possible intellig...

AI and Food Industy - The new Agriculture (Part II)

Being a farmer is not only making plants grow. Apart from all the care applied to the plants, they also need to collect what has been produced. The harvesting of agricultural products is one of the most difficult, and delicate stages in the food production chain. Harvesting strawberries - Photo by Farsai Chaikulngamdee on Unsplash Millions of people are employed in this process. It is a seasoned process what means temporary jobs. These jobs are mostly available in the summer season, where we reach the harvest phase for the majority of the plants. Many farmers dedicate themselves to fruit growth. In this agriculture's field, we have to take care of plants and then pick the fruits. As you may think, this is a hard and repetitive task. Image a farm with several acres of land. G etting all the fruits from the plants can take months and involve lots of people.  Hiring so many people is very expensive for farmers. Besides, people can harvest fruits inappropriately, reducing the fruit...