Make agentsets annotated lists, Implement count
[clnl] / src / main / nvm / base.lisp
index ea427fa7572763ace4fdd2d612a06e3ada503642..1df5022fbc08c73d4adb3d5131cc356566dc9c0c 100644 (file)
@@ -3,9 +3,19 @@
 (defvar *current-id* 0)
 
 (defvar *turtles* nil)
+(defvar *patches* nil)
 (defvar *myself* nil)
 (defvar *self* nil)
-(defvar *model* nil)
+(defvar *dimensions* nil)
 (defvar *topology* :torus)
+(defvar *ticks* nil)
 
-(defstruct turtle who color heading xcor ycor)
+(defstruct turtle who color heading xcor ycor (label "") (label-color 9.9d0) (size 1d0))
+(defstruct patch color xcor ycor)
+
+(defun agent-set-list (agent-set)
+ (cond
+  ((eql agent-set :turtles) *turtles*)
+  ((eql agent-set :patches) *patches*)
+  ((and (listp agent-set) (eql :agent-set (car agent-set))) (cdr agent-set))
+  (t (error "Doesn't seem to be an agent-set: ~A" agent-set))))