Dissemination of a virus is simulated following a few simple rules.
A number of inhabitants are assigned to each of the pixels of a bitmap.
A pixel is coloured if one or more residents are contaminated. Immunised persons are indicated in hues of blue.
Per iteration the program calculates the number of persons contaminated by their next neighbours as well as how far (how many pixels) an inhabitant has travelled. All parameters (i.e. the probability of transmission, de mean durations of contagiousness and immunity, the probability of death of a patient, the fraction of mobile persons and their mean mobility) are considered to be Poisson-distributed (see the figure below).
while (Zero(x)) x = Rand();
// draw a random number not equal to zero
x=-log(x) * Mean_probability_of_something;
// make it Poisson-distributed
// with mean Probability_of_something
|Yellow neighbours of a red pixel||A Possion distribution with a mean of 10||Get a random event|
The viral application is multithreaded, using up to 16 processor cores in parallel. It has a main window comprising possibly multiple child windows that may execute different simulations simultaneously. The commands pertaining to these child windows can be accessed through the viral menu, which has four items: Modify Palette, Parameters, Start and Stop. These items are also represented by buttons in the task bar at the top of the main window (see figure below). The 'stop' button is in fact a pause button, since if you push the 'resume' button , the simulation continues where you left it. This is contrary to the 'GO' button, which starts the simulation all over again at iteration 0.
The 'save data' button or the Save data item from the file menu saves three columns of tab-delimited numbers representing for each iteration the total number of healthy, ill and immune persons of the entire bitmap. These columns can be made into a graph using for instance one of the programs of Serf Suite, such as XLPlot.
After selection of the Parameters menu item, a dialogue window pops up. In this box you can set several parameters of which most are self-explanatory. The 'probability of transmission' refers to the probability that an infected person contaminates a healthy person during one iteration. After a mean period of 'mean duration of transmissibility' (contagiousness) an ill person becomes immunised. He looses immunity after a period of 'mean duration of immunity'. The 'elimination rate' is a euphemism for death rate. Persons residing in one pixel can move to other pixels with a mean path length per iteration of 'mean mobility' and a random orientation.
The program stops iterating if the number of contagious pixels has become zero. You may also have it pause/stop at a particular iteration by setting a number other than 0 in the 'next pause at iteration' edit box. You may then change parameters if you wish and continue the simulation by pushing the 'resume' button.