anchor.diff:      :initarg :message
       :initform (error ":message missing")
       :reader message-of
  -    :type string)))
  -
  -
  -(defclass vibration (object)
  -  ((message
  -    :initarg :message
  -    :initform (error ":message missing")
  -    :reader message-of
  -    :type string)))
  -
  -
  -(defclass person (actor)
  +    :type string)
  +   (duration
  +    :reader duration-of
  +    :type time-type)))
  +
  +
  +(defclass person (simulator)
     ((name
       :initarg :name
       :initform (error ":name missing")
       :reader name-of
       :type string)
  -   (thought-in
  -    :accessor thought-in-of
  -    :type thought-in-port)
  -   (thought-out
  -    :accessor thought-out-of
  -    :type thought-out-port)
      (voice-in
       :accessor voice-in-of
       :type voice-in-port)
  
positive.code: 
  (defun voice->vibration (vo)
    (declare (voice vo))
    (make-instance 'vibration :message (message-of vo)))
  
  
  (defmethod print-object ((p person) s)
    (print-unreadable-object (p s :type t :identity t)
      (format s "path: ~a name: ~a" (path p) (name-of p))))
  
  
  (defmethod print-object ((csp csp-scenario) s)
    (with-accessors ((alice alice-of) (bob bob-of)
  		   (a-can a-can-of) (b-can b-can-of)
  		   (wire wire-of)) csp
      (print-unreadable-object (csp s :type t :identity t)
        (format s "path: ~a" (path csp)))))
  
  
  
  ;; PERSON BEHAVIOUR
  
  ;; schedulable
  (defmethod think ((p person) (evs list))
    (schedule p evs (make-instance 'event
  				 :owner-path (path p)
  				 :time (gettime evs)
  				 :fn #'handle-input
  				 :args (list (thought-in-of p)
  					     nil))))
  
  
  ;; schedulable
  (defmethod handle-input ((p person) (evs list) (in thought-in-port)
  			 (str string))
    "thought-in ---> voice-out"
    (let ((vo (make-instance 'voice :message str)))
      (schedule p evs (make-instance 'event
  				   :owner-path (path p)
  				   :time (gettime evs)
  				   :fn #'put
  				   :args (list (voice-out-of p)
  					       vo)))))
  
  
  ;; schedulable
  (defmethod handle-input ((p person) (evs list) (in voice-in-port)
  			 (vo voice))
    "voice-in ---> thought-out"
    (schedule p evs (make-instance 'event
  				 :owner-path (path p)
  				 :time (gettime evs)
  				 :fn #'put
  				 :args (list (thought-out-of p)
  					     (message-of vo)))))
  
  
  ;; CAN BEHAVIOUR
  
  ;; schedulable
  (defmethod handle-input ((c can) (evs list) (in voice-in-port)
  			 (vo voice))
    "voice-in ---> vibration-out"
    (schedule c evs (make-instance 'event
  				 :owner-path (path c)
  				 :time (gettime evs)
  				 :fn #'put
  				 :args (list (vibration-out-of c)
  					     (voice->vibration vo)))))
  
  
  (defmethod handle-input ((c can) (evs list) (in vibration-in-port)
  			 (vi vibration))
    "vibration-in ---> voice-out"
    (schedule c evs (make-instance 'event
  				 :owner-path (path c)
  				 :time (gettime evs)
  				 :fn #'put
  				 :args (list (voice-out-of c)
  					     (vibration->voice vi)))))
  
  
  ;; WIRE BEHAVIOUR
  
  ;; schedulable
  (defmethod handle-input ((w wire) (evs list) (in vibration-in-port)
  			 (vi vibration))
    "vibration-in ---> vibration-out"
    (let ((out (if (eq in (a-vibration-in-of w))
  		 (b-vibration-out-of w)
  		 (a-vibration-out-of w))))
      (schedule w evs (make-instance 'event
  				   :owner-path (path w)
  				   :time (gettime evs)
  				   :fn #'put
  				   :args (list out vi)))))
  
  (defun fresh-csp-scenario ()
    (make-instance 'csp-scenario
  		 :alice (make-instance 'person :name "Alice")
  		 :bob (make-instance 'person :name "Bob")
  		 :a-can (make-instance 'can)
  		 :b-can (make-instance 'can)
  		 :wire (make-instance 'wire)))
  
  
  (defmethod run ((csp csp-scenario))
    (labels ((run-rec (csp evs)
  	     (if (null evs)
  		 csp
  		 (multiple-value-call #'run-rec
  		   (evolve csp evs)))))
      (with-accessors ((alice alice-of)) csp
        (multiple-value-bind (act evs)
  	  (schedule alice nil
  		    (make-instance 'event
  				   :owner-path (path alice)
  				   :time 0
  				   :fn #'think))
  	(run-rec (update-component csp act (id-of act))
  		 evs)))))
  
negative.code:     :type voice-out-port)))
  
  
  (defclass can (simulator)
    ((voice-in
      :accessor voice-in-of
      :type voice-in-port)
  