Simulate network of human interactions using NetLogo

advertisement
Disease propagation through a network
Learning objectives:

Simulating spread of an infectious disease using agent-based modeling

Simulating a spatially clustered network of individuals
NetLogo is a software platform for exploration of complex systems. If you would like to know
more about the software, you can check out the NetLogo website, as well as this Wikipedia
entry. Among the resources available at the NetLogo website are tutorials and a full software
documentation. Parts of this lab are adapted from a NetLogo Tutorial on modeling epidemic
spread. If NetLogo is not yet installed on your computer, you will need to download it from the
NetLogo website and install it prior to working through this project.
We will construct a model of disease spread in a small human population where the disease is
transmitted from person to person through direct contact. An agent-based approach will be
taken. In this approach, each individual in the population is explicitly represented as an agent,
and simulations are performed according to the rules that govern the interactions of agents.
Model Development
Before starting to work with an agent-based model it is necessary to think about:
 How many different types individuals there are in the model?
 What are the rules that govern an individual’s interactions?
 How do the individuals change their states?
 What are the rules that govern these changes?
In general models of disease dynamics, we may want to model animal and plant diseases as
well as diseases of humans, and the term host is used to refer to an individual of any kind who
may catch the disease. Infectious diseases of hosts are caused by pathogens, which are other
kinds of organisms, such as viruses, bacteria, protozoans, or fungi that grow and reproduce
inside their hosts (at the expense of the host's resources) and can spread from host to host.
In many cases, at any given time, the host population can be partitioned into an S-compartment
that comprises hosts that are susceptible to the disease (healthy hosts in our case), an Icompartment that comprises infectious hosts (sick hosts in our case), and an R-compartment
that comprises removed hosts (in our case, recovered host, whose immunity removes them
from the danger of subsequent infection). This approach allows, among other things, to
simulate the spread of the disease in the population of hosts.
To summarize, at any given time our host population can be partitioned into three
compartments:
1



Healthy hosts (S-compartment)
Sick and infectious hosts (I-compartment)
Recovered hosts (R-compartment)
Hosts in the model are only able to follow simple rules of the form:
If some condition(s) is (are) true, then take some action(s)
Such If-Then statements or transition rules are among the most common tools of computer
programming. NetLogo, as well as many other types of software, works by checking whether
the conditions are satisfied and taking the specified actions according to the rule.
To model the spread of a disease, our hosts will need to interact and move between
compartments according to the following rules that will govern their transition from one state
(healthy, sick, and recovered) to another.
Transition rules:
 Action: A healthy host becomes sick
o Condition: Sometimes, when a healthy host has contact with a sick host
 Action: A sick host recovers
o Condition: Eventually
Let’s look at an example of a simple model which simulates the spread of an infectious disease.
1. Running the simulation
Click on the NetLogo icon. You should see the following Netlogo window:
Click “File”->”Models Library”
2
Click on “Sample Models” folder, and then choose subfolder “epiDEM Basic”.
Choose “epiDEM Basic” and click “Open” on the bottom of the screen.
3
The simulation windows should appear. Click on “Setup” and then “Go”
The simulation will show individual hosts which will move within the simulation window and
change color according to their current states. White figures represent susceptible hosts, red
figures represent infectious hosts and green figures represent recovered hosts. The simulation
will run until everybody recovers. Let’s explore the results of the simulation.
4
There are four panels which represent the results of the simulation. Capture the image
of each panel in your simulation and insert them in the space below. Use the Info Tab to
understand what each panel represents. Summarize your findings below each panel.
2. Analyze the results of NetLogo simulation
2.1. Usually an outbreak of a disease is called an epidemic if a significant fraction of the
population experiences infection. For our purposes, we will consider an epidemic to
have occurred when 50% of the population experienced. How long does the epidemic
in your simulation last? (Hint: if you place the mouse inside the graph, you should see
the x- and y- coordinates of the mouse.)
2.2. Since disease transmission is based on random events, we do not know if our results
are reproducible. We need to run a large number of simulations to make sure that our
simulations are consistent with each other. Run five simulations and fill out the table
below:
Simulation #
1
2
3
4
5
Epidemic duration (hrs)
R0
Max # of infected
2.3. Are the data from your simulations similar? Summarize the findings of your
simulations in two or three sentences. If not, explain how discrepancies may arise in
separate runs of the simulation.
5
3. Changing simulation-specific parameters
We are currently running the simulation with a default choice of parameters for disease
spread and hosts interaction. To adapt our simulation to a specific populations or specific
diseases, we want to change the parameters of the simulations. At the top left corner of the
NetLogo window, there are four scrollbars that enable you to change the parameters.
4. Use the Info Tab to understand what each scrollbar represents. Experiment with the
scrollbars by selecting multiple values of each parameter. Summarize your findings below
the name of each scrollbar
Initial-people
Infection-chance
Recovery chance
Average-recovery-time
5. Conducting numerical experiments using NetLogo
Conduct numerical experiments by running simulations with different settings of the
parameter “infection-chance.” How does this parameter appear to influence the spread
of a disease through the population? Which settings make epidemics more severe?
6
Could you provide an example of disease with high infection chance? Low infection
chance?
Simulate network of human interactions using NetLogo
Up to this point, we have assumed that our hosts have random contacts that may lead
to disease transmission. However, analysis of human interactions shows that we like to
form contact networks of friends/coworkers/neighbors and diseases spread through
such networks. We will use NetLogo to simulate networks of human interactions and
try to understand how infectious disease spreads through such networks.
5.1. Running a network simulation
Open the directory that you created when unzipping the files for this module and
double-click on “virus_on_network3.nlogo”. You should get a NetLogo window that
looks like this:
Change the slider on the top of the screen from “normal speed” to “slower”
Manipulate the sliders to set number-of-nodes = 20
and average-node-
degree = 2
The type of network is determined by the “Network type” menu. By default, the
program will build a network of agents who form small groups (clusters). Such a
network is called a spatially clustered network. One example of a spatially clustered
7
network is a network of students living in a dorm. Set the network by clicking
.
NetLogo will represent hosts by putting dots in the simulation space and will connect the
hosts into a network by drawing line segments between any two hosts that have frequent
contact. A red dot represents an infected host and a green dot represents a susceptible
host. Insert the image of your network in the space below:
5.2. By default, our Netlogo code assumes that initially there are 10 hosts. If we are trying
to run a realistic simulation for disease spread in a student dorm, it would be more
realistic to assume that initially there is only one student who has the disease. The
initial number of infected in the NetLogo code is controlled by the “initial-outbreaksize” slider
Click
and let the model run until the disease runs its course. Feel free to slow
down or speed up your simulation. You can stop the simulation by de-selecting the
“Go” button. Insert an image of the “Network Status” window in the space below.
6. Effect of long-term resistance on the dynamics of infectious disease
By default, our NetLogo code assumes that individuals do not acquire immunity to the
disease. Let’s instead assume that after recovery from the disease, everybody becomes
immune (by setting
subsequently losing the immunity (
) and that there is a 25% chance of
). Let us then experiment with
8
the effect of various settings of the parameter “lose-resistance-chance” on the dynamics
of the disease.
Fill out the table below. For each parameter setting, conduct multiple simulation runs.
Chance of losing
immunity to the
disease
Effect on the spread of the disease through the population and
the proportion of hosts that are infectious at any given time
What can you conclude about the effect of loss of immunity on disease propagation
through the spatially clustered network?
Note: From this point on, keep the “lose-resistance chance” at 0%.
7. Determine the effect of average number of interactions on disease spread.
Although the number of interactions for each host is random, we can simulate the
average level of “sociability” in our network by varying the average number of
interactions for each agent using the scrollbar “average-node-degree.”
.
7.1. Conduct a numerical experiment on the effect of average number of interactions on
disease spread in the network. For each parameter setting, conduct multiple
simulation runs. How does this number appear to affect the speed at which the disease
spreads or the proportion of hosts who will experience infection during the outbreak?
8. Does it matter who is initially infected?
By default, the initially infected individual is selected randomly. However, you can
manually choose an individual (node) to be initially infected, susceptible or recovered
by clicking the Select button and then left-clicking one, two or three times on the node.
9
As shown in the screenshot, set number-of-nodes to 20
degree to 2
0%
, average-node-
, initial-outbreak-size to 1
, recovery-chance to
and gain-resistance-chance to 0%
. Conduct a
numerical experiment on the effect of location of the initially infected individual on the
disease spread through the spatially clustered network. Use the
button to
repeatedly explore the same network, but change the initially infected node. Explore
several runs per node that you selected.
Describe in a few sentences what you observe. Does it matter who is initially infected?
How would you explain these observations?
Now repeat the exercise with recovery-chance set to 1.0%
resistance-chance set to 100%
and gain-
. Describe in a few sentences what you
observe. How do the observed outcomes differ from what you observed for the
previous settings? How would you explain these observations?
Note1 : To return the states of all nodes in the network to their initial values, click
Note2 : To generate a new random network, click on
.
.
Note 3: To return all sliders to their original values, click
10
Download