The experts use computer simulations to predict how a pandemic or epidemic will spread through the population. But for most people, the idea of a computer simulation being used to make decisions that affect all our lives, seems very distant. It’s potentially difficult to understand how these simulations relate to the real world and hard to decide if they are giving useful predictions.
I feel like the best way to understand something is to have a go. So that's what I have done, and I thought I would give anyone else who wishes, the opportunity to have a go as well. So I have coded up my own small simulation of a spreading virus. You can download it here! Download it to your laptop or PC and just double click it to get going. Unfortunately I’ve never written apps for phones, so there isn’t an app version - you will need a laptop or PC.
What this is and what this isn’t
This is what scientists refer to as a toy model. This means it is a simulation that captures some of the basic things that are going on, but it does not include all the complexities of the real world. Also this simulation was written by a scientist who measures weather, not a scientist who measures spread of diseases. Just like everything you find on the internet, accept it with a healthy chunk of scepticism.In this simulation, a series of dots wander randomly around on your screen. 5 of them are infected with a virus! The virus has three stages. Initially a dot is simply a carrier, you will see it’s colour change to a lighter shade of grey. In the second stage the virus is contagious. At this point the dot will turn pink and if it gets too close to another dot, it passes the virus on. Most dots only have these two phases and they fully recover. Recovered dots are immune from getting the virus again and are blue. Unfortunately some dots hit the third viral stage and become critically ill, turning dark red. A fraction of these will die becoming a white dot. If the health system becomes overloaded with critical patients, you will see the statistics in the corner turn red, and any critically ill dots who cannot get an intensive care bed will die. As the simulation progresses you can see the reproduction number of the virus and the charts showing the fraction of dots at the different stages.
You can affect how things pan out, by changing the simulation setup. You can adjust parameters, such as how deadly the virus is, how many dots there are, how much they move around to spread the virus and how many intensive care beds there are. You can also lockdown the population, protect the vulnerable and induce new infections. The default setup gives a reproduction number around 2. This is close to that of Coronavirus. The number of dots is 4000, so if you wish to equate that with the UK population, each dot would represent around 15,000 people. The number of intensive care beds is set to 6.6 per 100,000 dots, this is the same as the UK, and enough for approximately one quarter of a dot to have a bed! If you wish to change this, the countries with the most intensive care beds have between 5 and 35.
What happens in the simulation
I’ll only mention here what happens with the default setup if you change nothing; you can play to see what happens when you use different settings. Note that every simulation is random, so you won’t get exactly the same as me and you’ll get a slightly different result each time, even with the same setup. In a few cases the virus will just die out and that will be the end of it, but for most runs the virus will spread. It will start off low level then suddenly the number of cases will seem to shoot up. This is due to exponential growth. Quickly after your cases shoot up, you will run out of intensive care beds and dots will start dying. Remember each dot that dies would represent about 15,000 UK deaths, so once two dots have died, this is worse than a regular UK flu season, which kills around 20,000 people each year.Once the simulation has been running for a couple of minutes, if you are not hypnotised by the randomly moving dots, then you will notice the charts indicating the number of infectious andcarrier dots has stopped going up. This happens when about half the population have been infected. The reason is that the virus is running out of new hosts. Half the population is immune and this has halved the reproduction number. With a reproduction number of around 1, the virus stops spreading. However the death toll will have racked up. Soon after this, the number of cases starts falling. Eventually, the last case disappears and the outbreak is over.
In this default "do nothing" scenario, around 3000-3500 dots will have caught the virus, that 75-85% of all dots. between 150 and 200 dots probably died. That’s 3.7-5% of the population.
Have a go and see if you see the same, then have a play, to see how you can change things. Try reducing the amount of movement, to simulate social distancing or try doing lockdowns to eradicate the virus. Also, once the virus is gone, try reinfecting the population and see what happens. Feel free to add comments below to tell people what results you get.
Comments
Post a Comment