Turtle and Observer Command

sum-of-frogs-with pred-ilist ilist

Reports the total value of ilist when run over the turtles of breed frogs that satisfy pred-ilist. If there are no frogs in which pred-ilist is true, returns 0. Note: This command can also be executed by patches, for example within an ask-patches statement.
Example: sum-of-frogs-with (color = green) [age] returns the sum of all of the ages of the green frogs.

Related commands: