Virus CoronaVirus
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This model simulates the transmission and perpetuation of a virus in a human population.
Ecological biologists have suggested a number of factors which may influence the survival of a directly transmitted virus within a population. (Yorke, et al. "Seasonality and the requirements for perpetuation and eradication of viruses in populations." Journal of Epidemiology, volume 109, pages 103-123)
HOW IT WORKS
The model is initialized with 150 people, of which 10 are infected. People move randomly about the world in one of three states: healthy but susceptible to infection (green), sick and infectious (red), and healthy and immune (gray). People may die of infection or old age. When the population dips below the environment's "carrying capacity" (set at 300 in this model) healthy people may produce healthy (but susceptible) offspring.
Some of these factors are summarized below with an explanation of how each one is treated in this model.
The density of the population
Population density affects how often infected, immune and susceptible individuals come into contact with each other. You can change the size of the initial population through the NUMBER-PEOPLE slider.
Population turnover
As individuals die, some who die will be infected, some will be susceptible and some will be immune. All the new individuals who are born, replacing those who die, will be susceptible. People may die from the virus, the chances of which are determined by the slider CHANCE-RECOVER, or they may die of old age.
In this model, people die of old age at the age of 50 years. Reproduction rate is constant in this model. Each turn, if the carrying capacity hasn't been reached, every healthy individual has a 1% chance to reproduce.
Degree of immunity
If a person has been infected and recovered, how immune are they to the virus? We often assume that immunity lasts a lifetime and is assured, but in some cases immunity wears off in time and immunity might not be absolutely secure. In this model, immunity is secure, but it only lasts for a year.
Infectiousness (or transmissibility)
How easily does the virus spread? Some viruses with which we are familiar spread very easily. Some viruses spread from the smallest contact every time. Others (the HIV virus, which is responsible for AIDS, for example) require significant contact, perhaps many times, before the virus is transmitted. In this model, infectiousness is determined by the INFECTIOUSNESS slider.
Duration of infectiousness
How long is a person infected before they either recover or die? This length of time is essentially the virus's window of opportunity for transmission to new hosts. In this model, duration of infectiousness is determined by the DURATION slider.
Hard-coded parameters
Four important parameters of this model are set as constants in the code (See setup-constants
procedure). They can be exposed as sliders if desired. The turtles’ lifespan is set to 50 years, the carrying capacity of the world is set to 300, the duration of immunity is set to 52 weeks, and the birth-rate is set to a 1 in 100 chance of reproducing per tick when the number of people is less than the carrying capacity.
HOW TO USE IT
Each "tick" represents a week in the time scale of this model.
The INFECTIOUSNESS slider determines how great the chance is that virus transmission will occur when an infected person and susceptible person occupy the same patch. For instance, when the slider is set to 50, the virus will spread roughly once every two chance encounters.
The DURATION slider determines the number of weeks before an infected person either dies or recovers.
The CHANCE-RECOVER slider controls the likelihood that an infection will end in recovery/immunity. When this slider is set at zero, for instance, the infection is always deadly.
The SETUP button resets the graphics and plots and randomly distributes NUMBER-PEOPLE in the view. All but 10 of the people are set to be green susceptible people and 10 red infected people (of randomly distributed ages). The GO button starts the simulation and the plotting function.
The TURTLE-SHAPE chooser controls whether the people are visualized as person shapes or as circles.
Three output monitors show the percent of the population that is infected, the percent that is immune, and the number of years that have passed. The plot shows (in their respective colors) the number of susceptible, infected, and immune people. It also shows the number of individuals in the total population in blue.
THINGS TO NOTICE
The factors controlled by the three sliders interact to influence how likely the virus is to thrive in this population. Notice that in all cases, these factors must create a balance in which an adequate number of potential hosts remain available to the virus and in which the virus can adequately access those hosts.
Often there will initially be an explosion of infection since no one in the population is immune. This approximates the initial "outbreak" of a viral infection in a population, one that often has devastating consequences for the humans concerned. Soon, however, the virus becomes less common as the population dynamics change. What ultimately happens to the virus is determined by the factors controlled by the sliders.
Notice that viruses that are too successful at first (infecting almost everyone) may not survive in the long term. Since everyone infected generally dies or becomes immune as a result, the potential number of hosts is often limited. The exception to the above is when the DURATION slider is set so high that population turnover (reproduction) can keep up and provide new hosts.
THINGS TO TRY
Think about how different slider values might approximate the dynamics of real-life viruses. The famous Ebola virus in central Africa has a very short duration, a very high infectiousness value, and an extremely low recovery rate. For all the fear this virus has raised, how successful is it? Set the sliders appropriately and watch what happens.
The HIV virus, which causes AIDS, has an extremely long duration, an extremely low recovery rate, but an extremely low infectiousness value. How does a virus with these slider values fare in this model?
EXTENDING THE MODEL
Add additional sliders controlling the carrying capacity of the world (how many people can be in the world at one time), the average lifespan of the people and their birth-rate.
Build a similar model simulating viral infection of a non-human host with very different reproductive rates, lifespans, and population densities.
Add a slider controlling how long immunity lasts. You could also make immunity imperfect, so that immune turtles still have a small chance of getting infected. This chance could get higher over time.
VISUALIZATION
The circle visualization of the model comes from guidelines presented in Kornhauser, D., Wilensky, U., & Rand, W. (2009). http://ccl.northwestern.edu/papers/2009/Kornhauser,Wilensky&Rand_DesignGuidelinesABMViz.pdf.
At the lowest level, perceptual impediments arise when we exceed the limitations of our low-level visual system. Visual features that are difficult to distinguish can disable our pre-attentive processing capabilities. Pre-attentive processing can be hindered by other cognitive phenomena such as interference between visual features (Healey 2006).
The circle visualization in this model is supposed to make it easier to see when agents interact because overlap is easier to see between circles than between the "people" shapes. In the circle visualization, the circles merge to create new compound shapes. Thus, it is easier to perceive new compound shapes in the circle visualization. Does the circle visualization make it easier for you to see what is happening?
RELATED MODELS
- HIV
- Virus on a Network
CREDITS AND REFERENCES
This model can show an alternate visualization of the Virus model using circles to represent the people. It uses visualization techniques as recommended in the paper:
Kornhauser, D., Wilensky, U., & Rand, W. (2009). Design guidelines for agent based model visualization. Journal of Artificial Societies and Social Simulation, JASSS, 12(2), 1.
HOW TO CITE
If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.
For the model itself:
- Wilensky, U. (1998). NetLogo Virus model. http://ccl.northwestern.edu/netlogo/models/Virus. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
Please cite the NetLogo software as:
- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
COPYRIGHT AND LICENSE
Copyright 1998 Uri Wilensky.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.
This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.
This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001.
Comments and Questions
turtles-own [ sick? ;; if true, the turtle is sick infected? ;; if true, turtle is infected remaining-immunity ;; how many weeks of immunity the turtle has left sick-infected-time ;; how long, in weeks, the turtle has been infectious age ;; how many weeks old the turtle is sick-around ;; is there anyone sick around the turtle? nearest-sick ;; the nearest sick turtle around the full-life ;; how much the turtle will live get-sick-factor ;; disease recovery changes with age reproduce-number ;; Maximum number of sons/daughers a turtle may generate ] globals [ %infected ;; what % of the population is infectious %sick ;; what % of the population is sick %immune ;; what % of the population is immune %dead ;; Sickness death relative to total death (dead-sick / total-dead) dead-sick ;; How many ppl died by sickness dead-total ;; How many ppl died births ;; How many ppl born lifespan ;; the average lifespan of the turtle population chance-reproduce ;; The probability of a turtle being hatched each simulation tick per turtle in the simulation reproduce-factor ;; Factor of reproduction carrying-capacity ;; the number of turtles that can be in the world at one time immunity-duration ;; how many weeks immunity lasts ] ;; The setup is divided into four procedures to setup clear-all setup-constants setup-turtles update-global-variables update-display reset-ticks end ;; We create a variable number of turtles of which 10 are infectious, ;; and distribute them randomly to setup-turtles create-turtles number-people [ setxy random-xcor random-ycor set age random lifespan ;; Age is set full-life random-normal lifespan (10 * 52) while [full-life < age] [set age random lifespan] set sick-infected-time 0 set remaining-immunity 0 set infected? false update-size ;; easier to see set-get-sick-factor set-reproduce-number get-healthy ] ask n-of 0 turtles [ get-infected ] end to setup-constants set lifespan 70 * 52 ;; 70 times 52 weeks = 70 years = 3640 weeks old set carrying-capacity 2000 set reproduce-factor 0.1 set immunity-duration 9999 end to go update-chance-reproduce if random-float 100 < chance-new-infected [create-new-infected] if random-float 100 < chance-new-sick [create-new-sick] ask turtles [ update-size set-get-sick-factor get-older move flee if infected? [ infect get-sick ] if sick? [ recover-or-die ] ifelse sick? [ infect ] [ reproduce ] ] update-global-variables update-display tick end to set-get-sick-factor set get-sick-factor random-normal ( ((age / 52) ^ 6) * (1.78 * (10 ^ -11)) ) ( 0.5 ) end to get-sick ;; turtle procedure if sick-infected-time > 2 and random-float 100 < (chance-getting-sick * get-sick-factor);; [ set infected? false set sick? true set remaining-immunity 0] if sick-infected-time > duration [become-immune] end to get-infected ;; set infected? true set remaining-immunity 0 end to get-healthy ;; turtle procedure set sick? false set infected? false set remaining-immunity 0 set sick-infected-time 0 end to become-immune ;; turtle procedure set sick? false set infected? false set sick-infected-time 0 set remaining-immunity immunity-duration end to update-chance-reproduce if count turtles > 0 ;;[set chance-reproduce random-normal (100 * (reproduce-factor / count turtles) - (reproduce-factor / (count turtles * 10))) (count turtles / 10 ^ 4)] ;; The most ppl on the simulation, lesser is the intention of reproducing. Needs improvement [set chance-reproduce 1] end to set-reproduce-number ifelse maximum-sons-by-person > 0 [ set reproduce-number random (maximum-sons-by-person + 1) ] ;; random command excludes the number eg: random 4 generates 0, 1, 2 or 3. So I summed 1 to the variable. [ set reproduce-number 0 ] end to create-new-infected create-turtles 1 [ setxy random-xcor random-ycor set age random lifespan set full-life random-poisson lifespan set sick-infected-time 0 set remaining-immunity 0 update-size set-reproduce-number get-healthy get-infected ] end to create-new-sick create-turtles 1 [ setxy random-xcor random-ycor set age random lifespan set full-life random-poisson lifespan set sick-infected-time 0 set remaining-immunity 0 update-size set-reproduce-number get-healthy get-infected get-sick ] end to flee if flee-from-sick? [ find-sicks if any? sick-around [find-nearest-sick if distance nearest-sick < 2 [ bk 3 ]] ] end to find-sicks ;; Find group of sick ppl next to agent. set sick-around other turtles in-radius 5 with [ sick? ] end to find-nearest-sick ;; People Flee from nearest sick in the simulation set nearest-sick min-one-of sick-around [distance myself] end ;;Turtle counting variables are advanced. to get-older ;; turtle procedure ;; Turtles die of old age once their age exceeds the ;; lifespan (set at 50 years in this model). set age age + 1 if age > full-life [ set dead-total dead-total + 1 die ] if immune? [ set remaining-immunity remaining-immunity - 1 ] if infected? [ set sick-infected-time sick-infected-time + 1 ] if sick? [ set sick-infected-time sick-infected-time + 1 ] end ;; Turtles move about at random. to move ;; turtle procedure ifelse sick-can-move? [ rt random 100 lt random 100 ifelse age < (50 * 52) [ fd 1.0 ] [ fd 0.5 ] ] [ rt random 100 lt random 100 if sick? = false [ifelse age < (50 * 52) [ fd 1.0 ] [ fd 0.5 ] ]] end ;; If a turtle is sick, it infects other turtles on the same patch. ;; Immune turtles don't get sick. to infect ;; turtle procedure ask other turtles-here with [ not infected? and not immune? and not sick? ] [ if random-float 100 < infectiousness [ get-infected ] ] end ;; Once the turtle has been sick long enough, it ;; either recovers (and becomes immune) or it dies. to recover-or-die ;; turtle procedure if sick-infected-time > duration ;; If the turtle has survived past the virus' duration, then [ ifelse random-float 100 < chance-recover ;; either recover or die [ become-immune ] [ set dead-total dead-total + 1 set dead-sick dead-sick + 1 die ] ] end ;; If there are less turtles than the carrying-capacity ;; then turtles can reproduce. to reproduce if age > (18 * 52) and age < (55 * 52) [ if count turtles < carrying-capacity and random-float 100 < chance-reproduce and reproduce-number > 0 [ set reproduce-number reproduce-number - 1 set births births + 1 hatch 1 [ set age 1 set full-life random-normal lifespan (25 * 52) set-reproduce-number update-size set-get-sick-factor lt 45 fd 1 get-healthy ] ] ] end to update-size set size ((age / lifespan) * 1.5) + 0.5 end to update-global-variables if count turtles > 0 [ set %infected ((count turtles with [ infected? ] + count turtles with [sick?]) / count turtles) * 100 set %immune (count turtles with [ immune? ] / count turtles) * 100 set %sick (count turtles with [sick?] / count turtles) * 100 if dead-total > 0 [ set %dead (dead-sick / dead-total) * number-people ] ] end to update-display ask turtles [ if shape != turtle-shape [ set shape turtle-shape ] set color ifelse-value infected? [orange] ifelse-value sick? [ red ] [ ifelse-value immune? [ grey ] [ green ] ] if age > (55 * 52) [set shape "old"] ] end to-report immune? report remaining-immunity > 0 end to startup setup-constants ;; so that carrying-capacity can be used as upper bound of number-people slider end ; Copyright 1998 Uri Wilensky. ; See Info tab for full copyright and license.
There is only one version of this model, created over 5 years ago by Ramon Barros.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Virus CoronaVirus.png | preview | Preview for 'Virus CoronaVirus' | over 5 years ago, by Ramon Barros | Download |
This model does not have any ancestors.
This model does not have any descendants.