X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?p=clnl;a=blobdiff_plain;f=src%2Fmain%2Fnvm%2Fnvm.lisp;h=da42870c86d3cbc4129a4220a039c316bd60f75b;hp=f8fdd84bde3a72ecdc4c8e87f6db905e5c42ca44;hb=3528ea770bf54e0174976c48b64e036355b71601;hpb=0a00e056cd1a8f022128525ac3cf3494cc36159d diff --git a/src/main/nvm/nvm.lisp b/src/main/nvm/nvm.lisp index f8fdd84..da42870 100644 --- a/src/main/nvm/nvm.lisp +++ b/src/main/nvm/nvm.lisp @@ -100,7 +100,7 @@ DESCRIPTION: each time it's used, so changes depending on the state of the engine. See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#patches" - *patches*) + :patches) (defun turtles () "TURTLES => ALL-TURTLES @@ -117,7 +117,7 @@ DESCRIPTION: each time it's used, so changes depending on the state of the engine. See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#turtles" - *turtles*) + :turtles) (defun ask (agent-set fn) "ASK AGENT-SET FN => RESULT @@ -144,6 +144,22 @@ DESCRIPTION: :while agent :do (let ((*myself* *self*) (*self* agent)) (funcall fn))))) +(defun count (agent-set) + "COUNT AGENT-SET => N + +ARGUMENTS AND VALUES: + + AGENT-SET: a NetLogo agentset + N: a number + +DESCRIPTION: + + COUNT is equivalent to count in NetLogo. Returns N, the number of + agents in AGENT-SET. + + See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#count" + (coerce (length (agent-set-list agent-set)) 'double-float)) + (defun of (fn agent-set) "OF FN AGENT-SET => RESULT