Turtle, Observer, Patch

median-of-patches-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 patches that satisfy the conditions specified by the [1st list of commands].

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

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.

Related Commands:
average-of-patches-with max-of-patches-with median-of-patches min-of-patches-with mode-of-patches-with sdev-of-patches-with sum-of-patches-with variance-of-patches variance-of-patches-with