M. Drew LaMar
March 13, 2019
The model was designed to explore questions about virtual corridors. Under what conditions do the interactions of butterfly hilltopping behavior and landscape topography lead to the emergence of virtual corridors, that is, relatively narrow paths along which many butterflies move? How does variability in the butterflies’ tendency to move uphill affect the emergence of virtual corridors?
Question: What are the explanatory variables and processes and what is the system output we are interested in?
Process Overview and Scheduling There is only one process in the model: movement of the butterflies. On each time step, each butterfly moves once. The order in which the butterflies execute this action is unimportant because there are no interactions among the butterflies.
ask
, set
, let
, create-turtles
, ifelse
, and one-of
.Discuss: When you click the new setup button, why does NetLogo seem to color the patches in spots all over the View, instead of simply starting at the top and working down?
Answer: NetLogo always, by default, goes through turtles and patches in random order. This is an attempt to remove a possible confounding process -
agent ordering . This is an example ofasynchronous updating.
This is the programmers “Do as I say and not as I do!” Think of commenting as taking notes in your learning.
“Comments are needed to make code easier for others to understand, but they are also very useful to ourselves: after a few days or weeks go by, you might not remember why you wrote some part of your program as you did instead of in some other way.”
if
or ifelse
statements (i.e. after closing using ]
character);-----------
to separate procedures in long programs.show (word elev1 " " elev2 " " elevation)
The point is to make your code readable and understandable, so some caveats: