Turtle and Observer Command

max-of-patches-with [condition] [list of commands]

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. Note: This command can also be executed by patches, for example within an ask-patches statement.

Note: 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.

Examples:

max-of-patches-with [color = 0] [food] reports the largest food value of the black colored patches.

Related commands: