Infectious Disease Transmission Simulation

What is a virus?

A disease that gets transmitted between two or more living creatures. While viruses are not the only things that make people sick they are generally what people talk about when simulating diseases as they are more dangerous and harder to stop. There are several things we must understand before attempting to simulate them ( what a surprise ).

How are they spread?

This link has an excellent overview of the different ways to transmit a virus. The ones we care about the most ( and the easiest conceptually ) are direct, indirect, droplet, airborne and vector based. Direct means close physical contact, think STD. Indirect is when some jerk leaves snot on a doorknob and you get sick. Droplet is from a sneeze or cough usually. Airborne means it can survive outside the body for way too long, like Influenza or Polio. Vector based has less to do with linear algebra and more to do with mosquitoes. Now that we know how to get virtual people sick, we need to know how to simulate the disease itself.

What stages do viruses go through?

According to the disease transmission for idiots page getting sick isn't as simple as just: you are sick, now your friend is sick. From our perspective that is pretty close, but all simulations need numbers to tweak and this is where we get a nice handful.

Step 1 – Infection

The person does have the virus in their system, but not in quantities large enough to either show symptoms or spread it. This is called the latent period.

Step 2 - ???

There are two possible things that can occur here, the person can either get sick or get other people sick. The periods when these occur are called the symptomatic period and the infectious period respectfully. An important thing to note is there are four combinations, which calls for a chart.

No noticeable symptoms

Noticeable symptoms

Can't infect others

Latent period

Sick at home, but low risk to others

Can infect others

At work spreading the disease unknowingly

(silent infection)

Bad day had by all


Step 3 – Profit! … I mean Conclusion

The disease is over, the person has by now either gotten enough of the virus out of their system to return to normal, become immune to the disease or died. All solve the problem, albeit to varying levels of desirability.

How likely am I to get sick?

A good question, and the answer ( isn't it always? ) is: it depends. Generally for a given disease they ( scientists ) will affix a probability to various numbers, which just so happens to work out nicely with our needs. The most important one is transmission probability, i.e. if you come in contact with someone who is contagious what percentage on average will you get the disease as well? There are lots of factors that play into getting this number but we can fix a slider bar to it and let 'er rip. Some good probabilities to play with are: chance for healthy to become a carrier, chance for carrier to become sick, chance for sick to become dead, chance for sick to become immune and chance for immune to become healthy.

Just one more number

Another number you will see a lot in this area is the basic reproductive number, or R0 ( pronounced R-naught ). R0 is the number of people in the next generation only who on average will be infected by a given person before they get over it. Note that if this number is less than one, the infection won't have long to live as each generation it has fewer and fewer people.

Disease case study

Here we are going to look at some of the various details covered so far for a very real and very dangerous disease, Solanum.

Transmission method

Direct ( biting )

Latent period

Non existent ( nearly instantaneous )

Time until symptomatic

Minimal ( close to 0 )

Time until contagious

23 hours

Time until death

23 hours

Chance for healthy to become carrier


Chance for carrier to become sick


Chance for carrier to become immune


Chance for sick to become dead


R0 is difficult to pin down as it varies wildly depending on the number and actions of surrounding people, but in large cities it may escalate into the hundreds for a Class 3 outbreak.

Simulating disease transmission

Wait, isn't that supposed to be the main topic? Anyways for various ( and obvious ) reasons governments have a vested interest in knowing this kind of data before the outbreak occurs. As always we turn to the All-Knowing Wikipedia for the answers. This page looks at populations as a whole, which is a pretty common technique. Most of these methods use statistics to infer chances of outbreaks and spreads. At the opposite end of the spectrum we can look at individuals and their activities and use this to forecast. This has the advantage of being accurate for well known ( or well made up ) individuals and situations, but is infeasible on the scale of a large city or entire nation.

Epigrass showing off a high level view of an epidemic in Brazil

Method of looking at individuals proposed by Imperial London College

So as with all simulations the details are as fine grained as you need ( and can remain sane implementing ).

Extra links for over achievers:

What, you want more stuff? If I give you some links will you go away? Here, shoo!

Work copyright by Brian Paden, 2009 except where noted.