CSCI 1006 Lecture Notes - Lecture 2: Netlogo, Boolean Expression
To make a monitor
Count {turtles or patches} with [{p}color = {blue}]
- there is no cond in netlogo, so you have to do nested ifelse functions
- ifelse {Boolean expression}
[does this command if BE = true]
[does this command if BE = false or another ifelse]
* Distinguish between contexts and choose the most appropriate for a situation
- setup, crt, set variable are usually in the observer context
- if you are telling a turtle or patch to do something, it should be in those respective
contexts
- remember that ask turtles [] or ask patches [] will ask ALL turtles and patches to do
something, and will not ask turtles with a different breed.
RANDOM FUNCTIONS
to wiggle
lt random #
rt random #
fd #
end
find more resources at oneclass.com
find more resources at oneclass.com