Build an Epidemic Model (part 8 of 8)

Tagged:

Previous: Monitoring the Situation (part 7 of 8)

Graphing

It would also be useful to see how the numbers of infected and healthy agents compare over time. You can analyze their numbers with a line graph. Go to the Setup and Run tab and drag out a Line Graph block. We want to count the number of infected and healthy agents. So, similar to how we created a monitor from the previous step, drag out the Count Turtles With block (Turtles tab) along with the appropriate color blocks and = blocks onto the Runtime page of the canvas.

Look at the Runtime window and watch the values in the line graph change over time as the epidemic runs. Double-click on the Line Graph block for an enlarged view. Play with the Slider in the Runtime window and watch how the infected agents compare with the healthy agents as you lessen or lengthen the recovery time.

 

We've covered many of the basics of building a model in StarLogo TNG.Experiment with some variations on this model, and see what you can do. Try showing all the Immune turtles as a certain color. Try adding code to make the Turtles immune after they recover. What do you think will happen to the numbers of infected and healthy over time? You can also take a look at the other tutorials.

 

  Back To Top