max-of-turtles-with
[condition] [list of commands]
Parameters:
[condition] |
List of commands |
list of commands that evaluates to true or false |
[list of commands] |
Number |
list of commands that evaluate to a number |
Description:
Reports the highest value of [list of commands] when run over the turtles that satisfy condition. If there are no turtles in which [condition] is true, returns minnum
, the smallest number possible without going into negative infinity.
Examples:
max-of-turtles-with [color = red] [speed]
reports the speed
of the red turtle with the highest speed.
Notes:
This command can also be executed by patches, for example within an ask-patches
statement.
If [list of commands] contains no numbers, the smallest possible number is returned. If some of the [list of commands], when evaluated, are not numbers, those values are ignored.
When a turtle calls the command, it is not included as part of the calculation.
Related Commands:
max-of-patches-with
max-of-turtles
median-of-turtles-with
min-of-turtles-with
mode-of-turtles-with
sdev-of-turtles-with
sum-of-turtles-with
variance-of-turtles-with