CSP-AIMS Workshop  

Unit 3: Epidemic Model

                                                     

 

Model Overview:

 

     

In this lab, you will be creating a model that represents a simple epidemic spreading through a group of agents. The epidemic starts with one sick agent and the disease spreads to the rest of the agents by contact. In this model, agents (turtles) come in contact with each other by sharing the same patch.

The Basic Model:

The basic model has the following characteristics:  

 

v You should be able to change the initial number of agents (Turtles ) using a slider! Remember that when using a slider, the variable automatically becomes a global variable and does NOT need to be declared in the Code Tab using a globals statement.

CSP-AIMS Workshop  

v Each agent is either healthy or sick.

 

• •

You need to be able to visualize whether they are healthy or sick by their color (i.e. red agents are sick and green agents are healthy). You also need to create a Boolean Agent variable that contains that information (something like turtles-own [sick?]). If this Boolean variable is true for an agent, then that agent is sick. If it is false, then the agent is healthy)

v Initially only one agent is sick.

 

 

 

 

v Sick agents get other agents sick. This happens when a sick agent collides with a sick agent (i.e. the sick agent shares the same patch as a healthy agent). See the coding hint below. v Agents wiggle to move around. v The world wraps around. Your turtles live on a torus! v For the basic model - once an agent is sick, it stays sick forever: no recovery, no death, nothing. It is forced to wiggle around its world sick. Eventually all agents will get sick. v Graph the number of sick agents and the number of healthy agents giving each line a different color – there was a video that covered graphing so go back and watch it if you need help! Don’t forget about ticks! v Also add Monitors for number of sick and healthy agents. This will come in handy when you run your experiments.  

That’s it for the basic model!

Coding Hints: any? agentset returns true if agentset is not empty turtles-here returns an agentset of all turtles on the local patch (including the turtle making the call) other says to ignore the turtle making the call So, putting it all together: “ if any? other turtles-here [ …. ]” is a good way to run code

CSP-AIMS Workshop  

that should only run when you are encountering another agent. This is standard NetLogo “collision” code. Of course you can further refine the agentset using the with command.

 

Example, if any? other turtles-here with [color = red]

   

After you have created the Base Model you must add at least ONE of the following: 1. You allow the poor sick agents to pass away peacefully after a period of time. o To do this you will probably need a new agent variable (turtles-own) that would contain a number that represents how long they have been sick (perhaps SickTime) and a new global variable that holds the maximum amount of time that the turtles can be sick (perhaps MaxSickTime). o Sick turtles die after they have been sick for the maximum period of time (use the die command). o You will want to examine how changing the maximum amount of time that the turtles can be sick affects the models performance so you need a slider to enter that value. 2. After wandering around aimlessly, some sick agents finally find a clinic and are nursed back to health. o The sad truth that they do not know is that they can get sick again! o Set aside some portion of the NetLogo world to be a clinic (set the patches to be a different color). o You will want to be able to vary the size of the clinic. You will need to use a slider so that you can study how the size of the clinic affects the outcome of your model. o The easiest way to do this is to choose the upper corner of the NetLogo world and max-pxcor and max-pycor are the maximum x-coordinate and maximum y-coordinates. So a box (clinic) in the upper corner could be made by coloring patches with pxcor > max-pxcor - # and pycor > max-pycor - #. o How will you get the agents to notice that they have entered

CSP-AIMS Workshop  

the c l i n i c ? Don’t forget to check the pcolor that the agents are standing on. o Don’t forget to change the turtle’s color and turtle’s variable values to the healthy values once they are nursed back to health. 3. Good news, some of your agents are getting better! They are actually able to fend off this dreadful disease and are cured without going to the clinic. Not only are they cured; they are IMMUNE to the disease afterwards. o They are joyous and turn yellow – or whatever color means happiness to you. o You will want to create a variable and slider the represents the probability that a turtle will recover and become immune. Use that variable to control turtle recovery. o You probably will want to create a Boolean Agent variable that keeps track of whether or not they are immune (something like turtles-own [immune?]). Remember that the agents who are sick and get better and are now immune. If these agents come in contact with a sick agent, they do not get sick. So that means that you need to check this new Boolean agent variable every time a turtle comes in contact with a sick agent. o Add a line to your graph that represents the number of immune agents.

After you have created your model, you will run experiments. Complete the experimental design form to tell us what experiments you are going to run. You must explore the effect of two variables – one of which is the initial Number of Turtles and the other is related to the specific addition to your code from the three options above. You will vary each independent variable at least 4 times while keeping the other variable at one setting. Then you will vary the other variable at each point. You will repeat each set of parameters at least 3 times (that means 4X4X3 experiments). Please take the average results (dependent variable) of the 3 runs at each choice of variables.

 

Have Fun!  

CSP-AIMS Workshop  

Unit 3 Programming Assignment: Epidemic Grading Rubric (100 Points Total) Done Points Task 15

A: Upload 3-4 files to your Google website under NetLogo Projects/Week 3: Algorithms : • NetLogo source code with the file name: W3.firstname.lastname.nlogo. • You modified Experimental Design Form with the name: W3.firstname.lastname.EDF.doc • A screen capture (see note) of the your Interface Page after your model runs for a while with the name W3.firstname.lastname.Epi.png • If you choose to write up your experimental results in a separate document, please upload that file also. NOTE: save a screen capture from NetLogo by using: File→Export→Export View...

5 5 10 5

10

10 15 25

B. The first few lines of your Code tab are comments including your name, the date, and the assignment name (Unit 3: Epidemic Model). C: The code in the Code tab of your program is appropriately documented with “in-line comments”. D: Your program includes a description of what your program does in the Info tab. E: Correct Setup of the model you have chosen: • Slider for number of initial turtles • Slider for another variable for your model • The turtle-own variables initialized correctly. F: Output: o You have a graph that shows the number of sick and the number of healthy agents as the model progresses. If you added immunity to your model, the number of immune agents is also represented on the graph, o You have Monitors for number of sick, healthy and immune (if appropriate). G: The base model portion of the code works correctly – the sickness spreads throughout your world. H: The additional portion of your model works correctly! I: You have run your experiments and described the outcome EITHER in the info portion of the model OR in a separate document. If you use a separate document you must upload it to your portfolio.

CSP-AIMS Unit 3 lab - FINAL.pdf

v You should be able to change the initial number of agents (Turtles ) using a. slider! Remember that when using ... a global variable and does NOT need to be declared in the Code Tab using a ... stale air out and fresh wind in. But to others, it ...

302KB Sizes 1 Downloads 166 Views

Recommend Documents

Lab 3: Structure - GitHub
Structure Harvester is very easy to use, and is all web-based! You simply upload your zip file and then click “Harvest!” It may take a few minutes to run.

Lab 3 Example - GitHub
Download “polygonum.stru”'. • Look at “polygonum.stru” using a text editor. – Column 1 refers to individual ID (516 total individuals). – Column 2 refers to ...

UNIT 3 - eGyanKosh
the capital is bound to change correspondingly. It is totally based on Double Entry. System principles. The effect of transactions on Accounting Equation. 1. ... information. The procedure for large number is followed for a form, which is called the

Unit 3 - eGyanKosh
technology has evolved in business applications for the process of strategic ... One of the major advantages a data warehouse offers is that it allows a large ...

UNIT 3 - eGyanKosh
Assets = Total Claims. Assets = Liabilities + Capital. If there is any change in the amount of assets, or of the liability, the owner‟s claim or the capital is bound to change correspondingly. It is totally based on Double Entry. System principles.

Unit 3 - eGyanKosh
The data warehousing, online analytical processing (OLAP) and data ... For example, an electric billing company, by analysing data of a data warehouse can.

Grammar unit 3
Mar 20, 2013 - scientists / clone smoking / damage. Could doctors operate before the development of anaesthetic? Yes, but the patients suffered terrible pain!

UNIT 3 - eGyanKosh
Mar 27, 2004 - Workplace-I. 3.2 READING. You are Sudhir Taneja, Personnel officer at XYZ Company. You've received a. Memo from your Manager Ms. Renu Bhardwaj, giving you guidelines for screening the application letters you have received. Read Salil M

UNIT 2 ACTIVITY 3
Can move many passengers plus cargo. Used mostly for fun. 82 ... 6. The has wings and no. 5. The has a motor and no motor. A towplane helps it become airborne. wings. Only a few of ..... Lift Versus Weight 2" x 10" paper strips. Grades 1-3.

Lab 3.pdf
A possible source of variation could be inaccurate analyzing of data,. but a change ... Yes because if the cuff is released too quickly, blood may rush into the arm.

unit 3.pdf
faster than AWT )nets. ... iq,i .rze and arc raid out using the square ofa grid. .... A rir.rl-Lokshmonon A.P-CSE. Page 3 of 42. unit 3.pdf. unit 3.pdf. Open. Extract.

unit 3.pdf
things, the assembler may find out syntax errors. The logical errors or other. programming errors are not found out by the assembler. For completing all these.

Course 1 Unit 3 Practice
Feb 19, 2015 - than her brother Dyami. The sum of their ages is. 23 years. How old is Dyami? 25. Corrine and Elizabeth went out for dinner. The check for their dinner was $32.75. Corrine knows her dinner cost $18.95. How much did Elizabeth's dinner c

UNIT 3 EXTENSION.pdf
There are more words than you need. take risks • steep • hurt myself • fascinated • give me a thrill • go trekking. breathtaking • thrilled • lose our way • challenging.

unit 3.pdf
for the mnemonics and data in the assembly language program. ... data type that may be a constant, variable, string, etc. Another option of ... DW: Define Word.

unit 3 bonded labour - eGyanKosh
Feb 9, 1976 - The agent would beat me with a stick if I was not there on time, he beats .... accurate, authentic and up-to-date data about the magnitude of the problem. A .... be instituted in any Civil Court for the recovery of any bonded debt,.

UNIT –3 PARALLEL PROGRAMMING
Page 24. Parallel Algorithms &. Parallel Programming. Check Your Progress 3. 1) (a) syntax for parallel directive : #pragma omp parallel [set of clauses].

UNIT –3 PARALLEL PROGRAMMING
In the following code fragment, the directives indicate that the outer two loops are ... iii) Using a completely new programming language for parallel programming (e.g. Ada). ... execution of the user code beyond the end of the parallel construct.

EE 396: Lecture 3 - UCLA Vision Lab
Feb 15, 2011 - The irradiance R, that is, the light incident on the surface is directly recorded ... partials of u1 and u2 exist and are continuous by definition, and ...

EE 396: Lecture 3 - UCLA Vision Lab
Feb 15, 2011 - (which we will see again in more detail when we study image registration, see [2]). • The irradiance R, that is, the light incident on the surface is ...

Lab 3 Answer Key.pdf
*this will create a cross-tabulation table;. proc freq data ... to have only two decimal places;. title2 'Showing the ratio ... Lab 3 Answer Key.pdf. Lab 3 Answer Key.

D.SA302-Lab 9-3-SCP.pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. D.SA302-Lab 9-3-SCP.pdf. D.SA302-Lab 9-3-SCP.pdf. Open.Missing:

Unit 3 - Slideshow 3 - 2013 DistanceTimeGraphs.pdf
THE GRAPH when plotting points. Page 4 of 17. Unit 3 - Slideshow 3 - 2013 DistanceTimeGraphs.pdf. Unit 3 - Slideshow 3 - 2013 DistanceTimeGraphs.pdf.