Turtle, Observer, Patch

median-of-turtles-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 list of commands that evaluate to a number

Description:
Returns the median of the [2nd list of commands] when evaluated across all the turtles that satisfy the conditions specified by the [1st list of commands].

Examples:
median-of-patches-with [color = red] [energy] returns the median energy of all the red turtles.

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