anchor.diff:  (defmethod update (actor))
   
   (defclass mover (actor)
  -  ((move-fn
  -    :initarg :move-fn
  -    :accessor move-fn
  +  ((direction-fn
  +    :initarg :direction-fn
  +    :accessor direction-fn
       :initform (make-meander))
  +   (motivation
  +    :initarg :motivation
  +    :accessor motivation
  +    :initform 1.0)
  +   (heading
  +    :accessor heading
  +    :initform (random-heading))
  +   (max-speed
  +    :initarg :max-speed
  +    :accessor max-speed
  +    :initform 1.0)
      (name
       :initform 'mover)
      (status
       :initform 'meandering)))
  +
  +(defmethod draw ((actor mover) cr)
  +  (cairo-set-source-rgb cr 0.0 0.0 1.0)
  +  (cairo-set-line-width cr 3.0)
  +  (cairo-move-to cr (x actor) (- +drawing-area-height+ (y actor)))
  +  (cairo-line-to cr
  +                 (+ (x actor) (* 15 (cos (heading actor))))
  +                 (- +drawing-area-height+ (+ (y actor) (* 9 (sin (heading actor))))))
  +  (cairo-stroke cr)
  +  (call-next-method))
   
   (defclass sheep (mover)
     ((herd
  
positive.code: 
  (defmethod update ((mover sheep))
    (let* ((others (remove-if (lambda (x) (eq x mover)) (herd mover)))
           (dist (reduce #'min (mapcar (lambda (x) (distance x mover)) others))))
      (setf (status mover) (cond
                             ((> dist 100) 'lonely)
                             ((< dist 20) 'crowded)
                             (t 'content))))
    (call-next-method))
  
  (defun make-meander ()
    (flet ((random-direction ()
             (random (* 2 pi))))
      (let ((heading (random-direction)))
        #'(lambda (x y)
            (when (zerop (random 20)) (setf heading (random-direction)))
            (let ((tmp-heading (+ heading (random .3) -0.15)))
              (list (+ x (cos tmp-heading))
                    (+ y (sin tmp-heading))))))))
  
  (defun main ()
    (within-main-loop
     (let ((runningp t)
           (actors (make-herd 40))
           (window (make-instance 'gtk-window
                                  :type :toplevel
                                  :title "Village"))
  
negative.code:        (gtk-box-pack-start box ctrl-panel)
         (gtk-box-pack-start ctrl-panel start-button)
         (gtk-box-pack-start ctrl-panel stop-button)
         (gtk-box-pack-start ctrl-panel step-button)
         (gtk-widget-show-all window)
         (start-animation)))))
  