median-of-breed-with
[1st list of commands] [2nd list of commands]
Parameters:
[1st list of commands] |
List of commands |
list of commands that evaluates to true or false |
[2nd list of commands] |
List of commands |
list of commands that evaluate to a number |
Description:
Returns the median of the [2nd list of commands] when evaluated across all the turtles of the breed specified that satisfy the conditions specified by the [1st list of commands].
Examples:
median-of-frogs-with [color = red] [speed]
returns the median speed of all the red turtles of breed frogs.
median-of-cars-with [size > 4] [speed]
returns the median speed of all the turtles of size greater than 4 with breed cars.
Notes:
If [2nd list of commands] contains no numbers, an error occurs. If some of the [2nd 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
max-of-breed-with
median-of-turtles-with
min-of-breed-with
mode-of-breed-with
sdev-of-breed-with
sum-of-breed-with
variance-of-breed-with