Reputation: 45
I am trying to control the moving speed of turtles base on the population of its area. My problem is that how to count total number of turtles that have a distance smaller than 3 with current turtle, and store this number into a new variable?
Upvotes: 2
Views: 1930
Reputation: 17678
Have a look at the in-radius
primitive in the NetLogo dictionary. Most likely you will want a command similar to ask turtles [ set varname count turtles in-radius 3 ]
Upvotes: 3