ask-turtles-with
[condition] [list of commands]
Parameters:
| [condition] |
List of turtle commands |
An expression that returns a true or false value |
| [list of commands] |
List of turtle commands |
A list of commands for the turtles to run |
Description:
This observer command asks turtles satisfying [condition] to run the [list of commands].
Asking many turtles to do something is a moderately expensive operation since StarLogo creates a thread for each turtle. Try to group commands that you would have put into separate ask-turtles-with into the same one to minimize thread creation overhead.
Examples:
ask-turtles-with [color = red] [fd 1] tells all red turtles to move forward one step.
Related Commands:
ask-breed
ask-list-of-turtles
ask-patch-at
ask-patches
ask-turtle
ask-turtles