Download NetLogo 1.1 User Manual

Transcript
NetLogo 1.1 User Manual
;; prints the patch with the most turtles on it
mean
mean list
Reports the statistical mean of the numeric elements of the given list. Ignores non−numeric
elements. The mean is the average, i.e., the sum of the elements divided by the total number of
elements.
show mean values−from turtles [xcor]
;; prints the average of all the turtles' x coordinates
median
median list
Reports the statistical median of the numeric elements of the given list. Ignores non−numeric
elements. The median is the item that would be in the middle if all the items were arranged in order.
(If two items would be in the middle, the median is the average of the two.)
show median values−from turtles [xcor]
;; prints the median of all the turtles' x coordinates
member?
member? value list
member? string1 string2
For a list, reports true if the given value appears in the given list, otherwise reports false.
For a string, reports true or false depending on whether string1 appears anywhere inside string2 as
a substring.
show member? 2 [1 2 3]
=> true
show member? 4 [1 2 3]
=> false
show member? "rin" "string"
=> true
See also position.
min
min list
Reports the minimum number value in the list. It ignores other types of items.
show min values−from turtles [xcor]
;; prints the lowest x−coordinate of all the turtles
Primitives Dictionary
120