created with NetLogo
view/download model file: ERdiffusion.nlogo
This model is a mish-mash between the original ER model that comes with NetLogo (whose documentation this partly is) and an SI diffusion model (SocialTies model). SI means that individuals can be in two states - susceptible (meaning they can get the disease) or infected (meaning that they have the disease). Once they have the disease, they stay infected and can continue to infect others.
The original documentation is placed in quotes.
I've only really modified it to only optionally lay out the network, to have a probability 'p' of an infection spreading over an edge at each time step, and to plot the number of infected individuals over time.
Additionally, this is a diffusion model. After setting up the network with the desired number of nodes (num-nodes), it will infect one node at random. You can then step through the diffusion process either step by step (spread once) or until every node is infected (spread complete). The plot will show the number of nodes infected at each time point. The time monitor will give the current time, and in the case of the 'spread complete' option, how many steps it took until all the nodes are infected. Note that this is the SI model - nodes are either susceptible or infected and there is no recovery. The 'p' parameter gives the probability that a an infected node will infect a neighbor at each time step.
From here on down is Uri's original, much more organized documentation:
The model creates a network of the "numnodes" number of nodes with the given average degree, connecting pairs of nodes at random.
It then infects one individual at random.
The p slider determines the probability that an infected individual will infect a susceptible contact at every time step.
"The LAYOUT? switch controls whether or not the layout procedure is run. This procedure attempts to move the nodes around to make the structure of the network easier to see.
The PLOT? switch turns off the plots which speeds up the model.
The RESIZE-NODES button will make all of the nodes take on a size representative of their degree distribution. If you press it again the nodes will return to equal size.
If you want the model to run faster, you can turn off the LAYOUT? and PLOT? switches and/or freeze the view (using the on/off button in the control strip over the view). The LAYOUT? switch has the greatest effect on the speed of the model.
If you have LAYOUT? switched off, and then want the network to have a more appealing layout, press the REDO-LAYOUT button which will run the layout-step procedure until you press the button again. You can press REDO-LAYOUT at any time even if you had LAYOUT? switched on and it will try to make the network easier to see."
Use the p slider to specify the probability that an infected individual will infect a susceptible contact at every time step.
View the progress of the disease diffusion on the network on the plot showing the cumulative number of individuals infected.
You can also specify the number of nodes and the average degree/node.
Observe how varying the transmission probability p, and the average degree in the network affects the reach and speed of diffusion.
Try to see if you can create the SIS model - nodes recover and return to the 'susceptible state' after either a fixed time period, or with some probability at each time step. In this case you are looking for the conditions (e.g. given value of p or average degree) under which you will observe epidemics - outbreaks that affect a significant fraction of the network, vs. conditions under which the outbreak remains small and contained.
See other models in the Networks section of the Models Library, such as Giant Component.
See also Network Example, in the Code Examples section.
This model is based on:
Albert-Laszlo Barabasi. Linked: The New Science of Networks, Perseus Publishing, Cambridge, Massachusetts, pages 79-92.
For a more technical treatment, see:
Albert-Laszlo Barabasi & Reka Albert. Emergence of Scaling in Random Networks, Science, Vol 286, Issue 5439, 15 October 1999, pages 509-512.
Barabasi's webpage has additional information at: http://www.nd.edu/~alb/
The layout algorithm is based on the Fruchterman-Reingold layout algorithm. More information about this algorithm can be obtained at: http://citeseer.ist.psu.edu/fruchterman91graph.html.
For a model similar to the one described in the first extension, please consult:
W. Brian Arthur, "Urban Systems and Historical Path-Dependence", Chapt. 4 in Urban systems and Infrastructure, J. Ausubel and R. Herman (eds.), National Academy of Sciences, Washington, D.C., 1988.
To refer to this model in academic publications, please use: Wilensky, U. (2005). NetLogo Preferential Attachment model. http://ccl.northwestern.edu/netlogo/models/PreferentialAttachment. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
In other publications, please use: Copyright 2005 Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/PreferentialAttachment for terms of use.
This model was modified by Lada Adamic in 2007 to include a diffusion simulation.