Prims - Update ask, of to take agents
[clnl] / src / main / nvm / base.lisp
index ddd429ee265cf9ca01825340f13b340db20960d2..8f1595c1677d6f0c7edcac97ac7e159b25868561 100644 (file)
@@ -8,6 +8,23 @@
 (defvar *self* 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))))
+
+(defun agent-set-p (o)
+ (or
+  (eql o :turtles)
+  (eql o :patches)
+  (and (listp o) (eql :agent-set (car o)))))
+
+(defun agent-p (o)
+ (or (turtle-p o) (patch-p o)))