Turtle and Observer Command

median-of-patches-with [condition] [list of commands]

Returns the median of the [list of commands] when [list of commands]is evaluated for all patches satisfying [condition]. If none of the patches satisfy the condition, the minnum or the smallest possible number is returned.

Examples:
median-of-patches-with [color = red] [energy] returns a number corresponding to the median of the energies of all red patches.

Related commands:

median-of-patches median-of-frogs-with median-of-turtles-with average-of-patches variance-of-patches