average-of-breed-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 which returns a number |
Description:
Returns the numerical average of the [list of commands] when evaluated across all the turtles of breed frogs
that satisfy the condition (must return a boolean of true or false) specified by the [condition].
Examples:
average-of-frogs-with [color = red] [speed]
returns the average speed of all the red turtles of breed frogs.
Notes:
If [list of commands] contains no numbers, an error occurs. If some of the [list of commands], when evaluated, are not numbers, those values are ignored.
When a turtle calls the command, it, itself, is not included as part of the calculation.
Related Commands:
average-of-breed
average-of-patches-with
average-of-turtles-with
max-of-breed-with
median-of-breed-with
min-of-breed-with
mode-of-breed-with
sum-of-breed-with
variance-of-breed-with