max-of-patches-with
[condition] [list of commands]
Parameters:
[condition] |
List of commands |
list of commands that evaluates to true or false |
[list of commands] |
List of commands |
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 patches in which [condition] is true, reports minnum
, the smallest number possible without going into negative infinity.
Examples:
max-of-patches-with [color = 0] [food]
reports the largest food value of the black colored patches.
Notes:
This command can also be executed by patches, for example within an ask-patches
statement.
Related Commands:
max-of-turtles-with
median-of-patches-with
min-of-patches-with
mode-of-patches-with
sdev-of-patches-with
sum-of-patches-with
variance-of-patches-with