60 likes | 76 Views
Learn how to use monitors and plots in NetLogo to track variable changes and visualize outcomes in your program. Find out how to create monitors and plot lines, and how to adjust parameters using sliders.
E N D
In NetLogo, monitors are output windows that allow you to keep track of how a something (a variable, a reporter or an expression that evaluates to a value) changes by showing its value as the program is run. There are a number of fields you can change when creating a monitor. In this image, an entry in which field(s) will not have any impact on the value that appears in the monitor. • Reporter field • Decimal place field • Display name field • Font size field • C and D
If you build a game in NetLogo and create a reporter to display the score. What kind of code might you see in your program? Assume: globals[score] • report scores • if something = true [set score score + 1] • count score • count turtles = score • turtles-own [score]
Plots are used to display changes to values within a model as a model runs. There can be multiple values plotted in the model because it is possible to have plots with multiple pens. In a model of disease spreading through a population which lines might be used to plot outcomes? Assume: turtles-own [is-sick? is-infected?] • plot [is-sick?] of turtles • plot count turtles with [is-sick? = true] • plot count turtles with [is-sick? = false] • plot count turtles with [is-infected? = true] • b c and d above.
Assume that you are creating a model that requires a plot. You are not sure how to use plots. Which approach or approaches might help you figure out how plots work. • Use the built in NetLogo manual under Help > NetLogo Manual • Ask somebody who knows how to work with plots. • Add a plot widget to your model’s interface and play with it. • Look at other models that use plots and examine the code. • All of the above.
When modeling the spread of infectious disease there are many things (factors) that can affect the spread of the disease. These factors are often called the parameters in a NetLogo model. When running the model it is interesting to see how changing these parameters change the results. NetLogo programmers often use sliders in their models so that the model can be easily run at different settings. Which variable or variables would be a good parameters or “sliders” for an infectious disease model? • wiggle-rate (rate turtle move through the world) • number-contacts-before-infected • profession (“professional” “student” “wage earner”) • initial-population-density • All except c