Hello! I have a question about how NetLogo is handling the “red-count” and “blue-count” global variables in the Simple Birth Rates model. In the model, two global variables are definied, being “red-count” and “blue-count.” Each of those variables are meant to track the number of red and blue turtles throughout the simulation, respectively. However, there is no code in the model defining what red-count or blue-count is. Each variable is only mentioned once more each, in the “go-experiment” procedure. As far as I’m aware, there’s no code explicitly defining either red-count or blue-count, and yet the monitors in the Interface are able to track the count of each turtle color regardless. Does anyone with knowledge of NetLogo’s inner working know why this is? Thank you!
I do not have special knowledge but: If you edit the plot widget on the
Interface, you will see it contains the “set” statements that update
red-count and blue-count.
I personally do not like hiding important code in the Interface like
that, and in our book we advocate having even the plot updates coded on
the Code tab so they are easy to find and understand…
Steve Railsback
I agree with this. I think we’ll change this model in the next release to move the code that updates red-count
and blue-count
to the code tab.