Turtle, Observer, Patch

variance-of-turtles-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 variance of the [list of commands] when evaluated across all the turtles that satisfy the conditions (must return a boolean of true or false) specified by the [condition].

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

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