Turtle, Observer, Patch

max-of-breed-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 of breed specified by breed that satisfy [condition]. If there are no turtles of this breed for which [condition] is true, returns minnum, the smallest number possible without going into negative infinity.

Examples:
max-of-frogs-with [color = red] [speed] returns the red turtle with the greatest speed of breed frogs.

max-of-cars-with [color = blue] [size] returns the blue turtle with the greatest size of breed cars.

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:
average-of-breed-with median-of-breed-with min-of-breed-with min-of-turtles-with mode-of-breed-with sdev-of-breed-with sum-of-breed-with variance-of-breed-with