Week 2 DO NOW QUESTIONS

Download Report

Transcript Week 2 DO NOW QUESTIONS

Week 12
DO NOW QUESTIONS
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.
a.
b.
c.
d.
e.
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:
a.
b.
c.
d.
e.
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?]
a.
b.
c.
d.
e.
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.
a. Use the built in NetLogo manual under Help >
NetLogo Manual
b. Ask somebody who knows how to work with
plots.
c. Add a plot widget to your model’s interface and
play with it.
d. Look at other models that use plots and examine
the code.
e. 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?
a.
b.
c.
d.
e.
wiggle-rate (rate turtle move through the world)
number-contacts-before-infected
profession (“professional” “student” “wage earner”)
initial-population-density
All except c