ISSH 2011 ABM Track - Hands-on Exercise



Similar documents
Scicos is a Scilab toolbox included in the Scilab package. The Scicos editor can be opened by the scicos command

Auto Clicker Tutorial

14.1. bs^ir^qfkd=obcib`qflk= Ñçê=emI=rkfuI=~åÇ=léÉåsjp=eçëíë

MS Project Tutorial for Senior Design Using Microsoft Project to manage projects

Inside Blackboard Collaborate for Moderators

Getting Started With SPSS

Dr.Backup Remote Backup Service. Quick Start User Guide

Word 2007: Basics Learning Guide

COS 116 The Computational Universe Laboratory 9: Virus and Worm Propagation in Networks

SQL Server 2005: Report Builder

Getting Started with Excel Table of Contents

Fundamentals of Great Plains & Reporting Tools

Junk Settings. Options

REDUCING YOUR MICROSOFT OUTLOOK MAILBOX SIZE

Windows Movie Maker 2012

GETTING STARTED WITH SQL SERVER

Table of contents. 1. About the platform MetaTrader 4 platform Installation Logging in 5 - Common log in problems 5

Fingerprint Identity User Manual for the Griaule Biometric Framework Rev 1.00

Connecting to the Remote Desktop Service

APPENDIX B: FEMA 452: Risk Assessment Database V5.0. User Guide

In this article, learn how to create and manipulate masks through both the worksheet and graph window.

Adding Digital Signature and Encryption in Outlook

Using Windows XP and File Management Handout (Staff)

Microsoft Excel Tutorial

Organizing and Managing

User s Guide The SimSphere Biosphere/Atmosphere Modeling Tool

Systems Dynamics Using Vensim Personal Learning Edition (PLE) Download Vensim PLE at

FrontPage 2003: Forms

These instructions were tested on OS X Earlier or later versions may have slight or major differences in how things work and appear.

File Structure Best Practices / Troubleshooting

Software Development Environment. Installation Guide

VBSim. Symantec Computer Virus/Worm Simulation System. Version 1.2. Copyright 1999, Symantec Corporation

Creating a Gradebook in Excel

Using Microsoft Office 2013: Outlook. Gerry Kruyer

Migrating to Azure SQL Database

First Bytes Programming Lab 2

Introduction. POP and IMAP Servers. MAC1028 June 2007

IFAS Reports. Participant s Manual. Version 1.0

CITY OF BURLINGTON PUBLIC SCHOOLS MICROSOFT EXCHANGE 2010 OUTLOOK WEB APP USERS GUIDE

Ten easy steps to creating great MicroWorlds EX projects. Steve Robson

Table of Contents. 1. Overview Materials Required System Requirements User Mode Installation Instructions..

Applying a circular load. Immediate and consolidation settlement. Deformed contours. Query points and query lines. Graph query.

Microsoft Office Access 2007 Training

File Management Using Microsoft Windows

Atomic Force Microscope and Magnetic Force Microscope Background Information

IMPORTANT Please Read Me First

Working with Windows Handout

Outlook Web App McKinney ISD 5/27/2011

Creating XML Report Web Services

GelAnalyzer 2010 User s manual. Contents

MICROSOFT WINDOWS NAVIGATION

A computer running Windows Vista or Mac OS X

Unified Communications Using Microsoft Office Live Meeting 2007

How to Set-Up your Pay Pal Account and Collect Dues On-Line

Data representation and analysis in Excel

Detecting and Removing Spyware From Your Home Computer

ICP Data Entry Module Training document. HHC Data Entry Module Training Document

Setting up VPN and Remote Desktop for Home Use

Creating a Distribution List from an Excel Spreadsheet

SOS SO S O n O lin n e lin e Bac Ba kup cku ck p u USER MANUAL

Excel 2010: Create your first spreadsheet

Using Outlook WebAccess

Connecting to LRDC Fileserver Remotely Using Windows Vista/7 & SRemote VPN

Creating an Archive in Outlook

Managing Mailbox Space and Personal Folders

The main imovie window is divided into six major parts.

Evoluent Mouse Manager for Windows. Download the free driver at evoluent.com. The primary benefits of the Mouse Manager are:

Microsoft Outlook 2007 Calendar Features

Document Management Quick Start and Shortcut Guide

Chapter 2 Introduction to SPSS

Using. An excerpt from Smart Technology's getting started manual explaining the basics of the SmartBoard and how to use it.

Windows 7 Hard Disk Recovery

Albright College Self Service

TortoiseGIT / GIT Tutorial: Hosting a dedicated server with auto commit periodically on Windows 7 and Windows 8

MSP How to guide session 2 (Resources & Cost)

Introduction to MyAvatar Learning how to use the tool

Installation and Troubleshooting Guide for SSL-VPN CONNECTIONS Access

Quick Start User Guide

Outlook . User Guide IS TRAINING CENTER. 833 Chestnut St, Suite 600. Philadelphia, PA

WHO STEPS Surveillance Support Materials. STEPS Epi Info Training Guide

Perform this procedure when you need to add a recurring payment option, or when you need to change or withdraw it.

USER MANUAL FOR. autocue.com

Make Voice Calls and Share Documents using Skype*

Animations in Creo 3.0

Small Business. Software User Guide

Microsoft PowerPoint 2010 Handout

Terminal Server Guide

Department of Information Technology. Microsoft Outlook Outlook 101 Basic Functions

Workspaces Creating and Opening Pages Creating Ticker Lists Looking up Ticker Symbols Ticker Sync Groups Market Summary Snap Quote Key Statistics

Mastercam Instructions. KTH School of Architecture Digital Fabrication Lab - CNC Router Version

Installing Basic PAYE Tools onto a networked computer

Outlook basics. Identify user interface elements that you can use to accomplish basic tasks.

Fish Chomp. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

MET 306 Activity 6. Using Pro/MFG Milling Operations Creo 2.0. Machining a Mast Step

emerchant Gateway Installation Guide

Excel 2007 Basic knowledge

POINT OF SALE CASHIER GUIDE

Interactive Excel Spreadsheets:

Transcription:

ISSH 2011 ABM Track - Hands-on Exercise Authors: Shawn Brown, University of Pittsburgh, stbrown@psc.edu John Grefenstette, University of Pittsburgh, gref@pitt.edu Nathan Stone, Pittsburgh Supercomputing Center, stone@psc.edu Jeffrey Borrebach, University of Pittsburgh, jdb108@pitt.edu Bruce Y. Lee, University of Pittsburgh, byl1@pitt.edu Objective To learn about basic models of disease spread and mitigation and gain experience experimenting with an agent- based model. Also more advanced students will be able to learn and exercise NetLogo programming skills. Prerequisites This hands- on set of activities is intended for people with a basic knowledge of NetLogo. Some experience in programming for NetLogo would be advantageous. No experience is necessary in agent- based modeling or infectious disease modeling to complete this exercise. Background Agent- based modeling is a useful method for studying infectious disease spread through a population. With such a model, one can build a realistic virtual population and define a set of underlying rules governing the actions of each individual, and then watch population- level dynamics emerge. In this example, we will use a model of infectious disease spread based on proximity. The model population will consist of a number of people who will be susceptible to a disease. At the beginning of the simulation we will infect a small number of agents with a pathogen, and at each time step, other people within a certain distance from that person will become infected. After a period of time, the infected agents will recover, gaining a temporary immunity to infection. Eventually they will lose this immunity and return to being susceptible. Encapsulating this idea in the agents is a series of states that agents go through. The state model for each agent is termed SIRS for the states Susceptible, Infectious, Recovered, and Susceptible. This type of model can represent diseases in which no long- term immunity exists and are possibly periodically reoccurring in a population. Step 1: Exploring the model In this step we will open the NetLogo ABM Infectious Disease model for the first time, setup an initial population, and run a default simulation. Procedure

1. Download the NetLogo ABM Infectious Disease model from the following address: http://www.phdl.pitt.edu/issh2011/abm- Infectious- Base.nlogo.txt [Note: after downloading the file, remove the.txt from the end of the file name to turn it into an executable NetLogo file.] 2. Open the NetLogo model ABM- infectious- base.nlogo by double clicking on the file. (On some platforms you must first launch NetLogo, then select Open from the File menu... navigating to the ABM- infectious- base.nlogo file.) Below is what you should see upon opening the model, which is the Interface tab of the model. Execution Buttons Slider Inputs Monitors Plotter 3. Additional information about the model can be found in the Information tab. Click on this button and read about the model. 4. Reset all parameters to their default values by clicking the default button. 5. Let s run the model for the first time.

a. Click "setup" to generate an initial population containing susceptible agents and a few infectious agents. b. Click "go" to run the model. The model terminates when there are no more infectious agents. 6. Notice now that the values in the Monitors are not 0. Take note of the values (each are described in the Information section How To Use It ). Particularly note the Attack Rate Monitor, which is the percent of the population that gets infected during the simulation. 7. Also look at the Epidemic Curve Plotter. What are the behaviors of each of the plotted states? 8. Explore some of the other controls that are available to you: a. The "step" button advances the model one time step. Click "setup" and "step" to see single steps in action. b. The speed slider at the top on the Interface view can be used to control the speed of the model. Move the slider a little to the left of "normal speed" to see the simulation in slow motion. You can change the slider at any time to change the speed of the simulation. 9. Now run the model several times (click setup and then go ). Do you get the same attack rate each time you run the model? Did you expect it to be the same? 10. Run the model 10 times, noting the Attack Rate for each run. What is the range you observe? What is the average attack rate for the set of runs? Optional: To make it easier (faster) to re- run the model, add an Action Key (a keyboard shortcut) to activate the setup and go buttons. To do this, right- click on each of these buttons, and select Edit.... In the edit dialog box, enter a single letter (e.g. s or g ) in the Action Key box, and then hit OK. You can now activate that button by pressing the key you assigned. 11. Run the model another 10 times, is the Attack Rate average similar to the previous set of 10? If not, average all 20. Continue to do this until the average does not change significantly (it is left to the student to determine when this is, but changes in the first decimal place are generally insignificant). It is recommended that if you have a spreadsheet program available to you, you can use this to record your results. Step 2: Sensitivity Analysis of Initial Conditions

Now that we have a baseline model of disease spread through a population, it is time to explore how each of the parameters we have put into the model affects the outcome. This is one of the most powerful capabilities of a model the ability to explore dynamically the relationships between the variables used to define the model. In the case of agent- based models, one can vary the parameters used to define individual agent actions and see how these effect the overall system. Procedure We will perform some sensitivity analysis of the variables in this model. 1. Let s first look at sensitivity to the population size. a. First, think about the model and predict what you think will happen as the population gets larger and smaller? Do you think the Attack Rate will increase or decrease? b. Click the default button to make sure we have the values at their starting point. c. Locate the Population Slider on the interface and note the default value (should be 500). d. Perform a parameter sweep of the Population value. Record the average Attack Rate of 10 runs for the values of 250, 500, 750, and 1000. How did your prediction hold up? 2. Explore the sensitivity of the model to each of the initial conditions, repeating the procedure performed for the Population parameter, described above. For each case, try to predict how the Attack Rate might change before running the simulation. Use the values below: a. Initial cases: 1, 5, 10 b. Infection- radius: 1, 3, 5, 10, 20 c. Days- infectious: 5, 10, 20 d. Days- immune: 10, 20, 30, 50, 100 3. Given what you have observed from these sensitivity analyses, to which variable is the model most sensitive and least sensitive? 4. Because agents can become susceptible after being infectious, it is possible to have the model exhibit a periodic behavior. Based on your new insight into the model, try to find which conditions lead to this periodic behavior in the epidemic? (Hint: manipulating the Days- immune and Days- infectious may give you the most bang here.)

Adding Vaccination and Prior Immunity Vaccination is a primary mitigation strategy for reducing the spread of disease in a population. Vaccines provide people with immunity to a disease by stimulating their immune system into producing antibodies against it. Vaccination usually involves introducing a weakened form of the pathogen (orally, by injection, etc.) to allow the body to recognize it in a safe way. In this part of the exercise, we will alter the previous NetLogo model so that agents can become immune to the disease through vaccination. This will be done in two steps: First adding immunity to agents at the beginning of the simulation run, and then using this mechanism to simulate vaccination. This exercise will help the student to learn several skills, including adding new features to both the Interface and Procedures sections of the NetLogo program. Before proceeding, use the File- > Save As item from the top menu to save the model under the name ABM- Infectious- Immunity.nlogo. It is a good idea to save your model before making a lot of changes. Step 1. Add Immune state and Prior Immunity to model In many cases, when a disease enters a population, there are people who have been exposed to diseases in the past that are similar and therefore have prior immunity granted from this experience. The 2009 H1N1 Influenza epidemic is an example of this because a large number of older people had previously been exposed to H1N1 strains. Prior immunity in the population can have quite a significant effect on the dynamics of disease spread and is important to include in models. The common letter used to symbolize the immune state is M. We will be adding this feature to the model. Key inputs for this feature will be: Percent of the population with prior immunity Procedure At the beginning of the simulation, the model needs to be able to assign immunity to some agents (turtles in NetLogo speak). For a random pass through the population at time 0, if a random number between 0 and 100 is below a target threshold, the agent is declared to be immune. First we will alter the Interface. 1. Add a new slider box (place it directly next to the Days- immune slider). a. Right- click anywhere on the Interface, and select Slider from the menu. b. A new slide should appear as well as a Slider dialog box. Give it the name Prior- Immunity, and make sure the following variables are set:

Minimum: Increment: Maximum: Value: 0 0 1 100 c. Click OK. You should see the new slider box somewhere in the interface screen. d. Right click on the new slider and select Select. This will allow you to move the new slider box and adjust its size. Place it in the empty spot next to Days- immune and make it the same size. 2. Add a new Monitor to keep track of the Immune agents. a. Right- click anywhere on the Interface and select Monitor from the menu. b. A new monitor box will appear as well as the Monitor dialog box. Type M in the Reporter box and make sure the following variables are set: Reporter: Display Name: Decimal places: M M 0 c. Click OK, and then place the box directly under the Attack Rate monitor in the interface, making it a similar size to the S, I, and R monitors. The M will be red, which means that you have more work to do to define this box (which we will get to shortly). 3. Add a new plot pen to the Epidemic Curves plotter for the M state. a. Right- click on the Epidemic Curves plotter and select Edit from the menu. b. In the resulting dialog box, there will be a line in the middle for Plot Pens. Click the Create button to create our new pen. Enter the name M for the name of the pen and click return. c. Select from the drop down menu Choose pen to edit the new pen M. Below that, select from the Color drop down the color blue. d. Click OK and the Epidemic Curves plotter should now have a M entry in the legend. When you have completed the previous three steps, your interface should look something similar to the one below:

Adding these features to the Interface is only one part of the task, we will now have to add procedures to the model to explain how immunity effects the dynamics of the model. To access the Procedures of the model, click on the Procedures tab at the top of the window. Take a moment to read through the procedures currently available in the model and familiarize yourself with them. There are comments throughout the code (indicated by ;; ) to help you understand what each procedure does. We will need to add some code to these procedures. 1. Add a global variable to keep track of agents in the M state. a. Add the variable M to the globals array. 2. Add the determination of prior- immunity to the setup procedure. a. In the setup procedure, there is a section that starts with ask turtles [, and this is a the place in the program where each agent is asked to set its initial parameters. Find the line that says ;; ISSH add prior immunity logic here.

b. Replace this line with the following code: if random 100 < Prior- Immunity [ set health- status "immune" ] This piece of code will select a random number between 0 and 100 and check if it is below the value set by the slide Prior- Immunity. If it is below, then the agent is given the immune status and cannot be infected throughout the simulation. 3. There is no need to add any logic to the step procedure. By setting these agents status to something other than susceptible, they can never be infected. 4. Add logic to set- agent- color procedure to portray immune agents as blue. a. Go to the set- agent- color procedure in the code. b. Replace the line ;; ISSH add immune color with the following line: if health- status = "immune" [ set color blue ] 5. Add logic to the collect- statistics procedure to track the people who are immune. a. Go to the collect- statistics procedure b. Replace the line ;;ISSH add immune stats with the following line: set M (count turtles with [health- status = "immune"]) 6. Add logic to the update- plots procedure to update the plot in the interface. a. Go to the update- plots procedure b. Replace the line ;;ISSH add immune pen with the following lines: set- current- plot- pen "M" plot 100 * M / Population These are all of the necessary changes to the Procedures to include prior immunity to the model. You can make sure that the code is correct syntactically by clicking the Check button on the top of the Procedures screen, and it will report any errors you may have made in typing. If it reveals any error, please work to correct them.

A copy of the finished code is provided at http://www.phdl.pitt.edu/issh2011/abm- Infectious- Immunity- Solution.nlogo.txt in case you get stuck or want to check your result. Now we are ready to run the model. One thing a programmer does in order to make sure a program is still working once a new feature is added is to run the program with feature turned off. 1. Go back to the Interface. 2. With the Prior- Immunity slider set to 0, rerun the model and see if you get similar results as before with the same parameters. 3. If the results are wildly different, go back and recheck the steps of the procedure to make sure you entered everything correctly (it is highly unlikely that this will occur). Now that we are confident that the modification is working, let's run some experiments. Perform a parameter sweep over Prior- Immunity (0%, 10%, 20%, and 30%) with the other parameters set to the default. Run the model ten times for each setting of prior immunity and record the average Attack Rate, Peak, and Peak day in all cases. How do they vary? Is this a highly sensitive parameter? Are the results what you expected them to be? Step 2: Adding Vaccination Now that we have added state of immunity to the model, and enabled it at the beginning of the simulation, we will add vaccination to the model. We will implement a basic one- time mass vaccination, which will be introduced as providing immunity on a specified day of the simulation. There are three major parameters that will define the vaccination: the day to vaccinate, the percentage of the population to give vaccines, and the vaccine efficacy. The first two are fairly self- explanatory. The vaccine efficacy is the probability that once a vaccine is given to a person there will be an immune response. In practice, efficacy rates can be much less than 100%. Procedure The basic mechanism for implementing the vaccination is that on the appointed day of the simulation that vaccination is to occur, a percentage of the population will receive vaccine, and then a percentage of these agents will have an efficacious response. Thus each agent will draw up to two random numbers: one to see if they get the vaccine and, if given the vaccine, a second to see if it is effective. Let s begin by adding the proper inputs to the Interface. 1. Create an Input box for the day to vaccinate.

a. Right- click anywhere on the interface and select Input from the menu. b. In the resulting dialog set: Global Variable: Type: Day- To- Vaccinate Number c. Click OK and move the box directly under the visualization window. 2. Add two new sliders named Vaccine- Efficacy and Percent- People- Vaccinated. They should both allow values for 0 to 100. Place them directly under the Input box just created. The resulting interface may look like this: Now we need to alter the Procedures to add vaccination. The work here needs to use the following logic

(pseudo- code): On simulation day X if day X is Day- To- Vaccinate for each agent if random number between 0 and 100 <= Percent- People- Vaccinated if random number between 0 and 100 <= Vaccine- Efficacy if agent s current health status is susceptible agent s health status = immune 3. The procedure responsible for defining the agent s daily activities is step. Add the preceding logic to this procedure. Once you have added this feature, test it to make sure it is behaving as you would think it should be. You can look for the following things: a. If all of the new values are set to 0, then the model should perform similar to before. b. Use the Epidemic Curves plotter and the step button to make sure that the appropriate percentage of people are becoming immune on the specified day. c. Vaccination should reduce the attack rate. 4. Once you are convinced that the vaccination feature is working, perform some parameter sweeps over the new variables to understand the behavior of the mitigation. A copy of the finished code is provided at http://www.phdl.pitt.edu/issh2011/abm- Infectious- Vaccine- Solution.nlogo.txt in case you want to compare with your result. Additional Projects and Enhancements If you are able to complete the previous portions of this hands- on exercise, here is a list of possible enhancements that you may want to make to the model. No procedures are given with these; it is left to the student to figure out how they should be accomplished. These enhancements can be performed in any order. Enhancement 1: Vaccination Rates When a vaccination program is introduced, it rarely occurs on one day, like we implemented above. Usually there is a rate of vaccination that starts when vaccines become available and a number of vaccines are given to the population each day. One enhancement would be to add a Vaccine Rate to model and then hand a number of vaccines starting from Day- To- Vaccinate. Enhancement 2: Time to Vaccine Efficacy

Vaccines generally do not take effect right away; there is usually a delay, the time from the administering the vaccine until the immune response occurs. Within that time, an agent can become infected with the disease and will not become immune from the vaccine. For example, the H1N1 vaccine has an average of 14 days to efficacy. Adding this to the model will require that each agent, if they have received an efficacious vaccine, keep track of when they were vaccinated and to check to see if the number of days in the delay has past. When the time for the vaccine to become efficacious arrives, a check on the agent s current disease status will need to be made, and only susceptible agents will then become immune. Enhancement 3: Temporary Vaccine Immunity Since we are working with an SIRS model, it would be interesting to look at vaccines that do not give permanent immunity. Influenza vaccines must be administered every year to susceptible populations because they provide an immune response that lasts for only several months. Adding this enhancement will require adding a new variable to define the length of immunity an agent receives from an efficacious vaccine, and then once that wears off, the agent needs to become susceptible to the disease again. Enhancement 4: Adding an Exposed State to the Disease Many diseases have additional states besides the ones that we currently have in the model. One such state would be the Exposed state. This is a state that occurs before infectiousness where a person has been infected, but is not able to transmit the disease to others. This state can simulate disease incubation periods, and disease like measles, influenza, and dengue have such a state. To add this enhancement, an entirely new state, called E, will need to be added to the model, and a new variable defining the length of this period will need to be introduced. Make sure that you add the proper Monitors and Plot Pens to the interface to track people in the E state. You should make the exposed people orange.