The links-own keyword, like the globals, breed, <breeds>-own, turtles-own, and patches-own keywords, can only be used at the beginning of a program, before any function definitions. It defines the variables belonging to each link.
If you specify a breed instead of "links", only links of that breed have the listed variables. (More than one link breed may list the same variable.)
undirected-link-breed [sidewalks sidewalk] directed-link-breed [streets street] links-own [traffic] ;; applies to all breeds sidewalks-own [pedestrians] streets-own [cars bikes]
Reports a list containing the given items. The items can be of any type, produced by any kind of reporter.
show list (random 10) (random 10) => [4 9] ;; or similar list show (list 5) => [5] show (list (random 10) 1 2 3 (random 10)) => [4 1 2 3 9] ;; or similar list
Reports the natural logarithm of number, that is, the logarithm to the base e (2.71828...).
Reports the logarithm of number in base base.
show log 64 2 => 6
See also ln.
Repeats the commands forever, or until the enclosing procedure exits through use of the stop or report commands.
to move-to-world-edge ;; turtle procedure loop [ if not can-move? 1 [ stop ] fd 1 ] end
In this example, stop
exits not just the loop, but the entire procedure.
Note: in many circumstances, it is more appropriate to use a forever button to repeat something indefinitely. See Buttons in the Programming Guide.
Adds value to the end of a list and reports the new list.
;; suppose mylist is [2 7 10 "Bob"] set mylist lput 42 mylist ;; mylist now is [2 7 10 "Bob" 42]
Take me to the full NetLogo Dictionary