1 (in-package #:clnl-nvm)
3 (defvar *current-id* 0)
9 (defvar *dimensions* nil)
10 (defvar *topology* :torus)
13 (defstruct turtle who color heading xcor ycor (label "") (label-color 9.9d0) (size 1d0))
14 (defstruct patch color xcor ycor)
16 (defun agentset-list (agentset)
18 ((eql agentset :turtles) *turtles*)
19 ((eql agentset :patches) *patches*)
20 ((and (listp agentset) (eql :agentset (car agentset))) (cddr agentset))
21 (t (error "Doesn't seem to be an agentset: ~A" agentset))))
23 (defun agentset-breed (agentset)
25 ((eql agentset :turtles) :turtles)
26 ((eql agentset :patches) :patches)
27 ((and (listp agentset) (eql :agentset (car agentset))) (second agentset))
28 (t (error "Doesn't seem to be an agentset: ~A" agentset))))
30 (defun list->agentset (list breed)
31 (append (list :agentset breed) list))
37 (and (listp o) (eql :agentset (car o)))))
40 (or (turtle-p o) (patch-p o)))