#+(and :allegro :allegro-ide) (in-package :common-graphics-user) #+(and :allegro (not :allegro-ide)) (in-package :common-lisp-user) #+(or :mcl :lispworks4.2 :cmu18 :sbcl) (in-package :common-lisp-user) (defagent *agent-01* "*Agent-01*" ;;; ============================================================================== ;;; Establish control nodes that sense state... ;;; IF a target can be located, THEN turn to face the target. (defsensor 1-rotate/follow *agent-01* (==> (and (target ?target ?agent) (location ?target ?x ?y ?z)) (turnto-location ?x ?y ?z 1))) ;;; ============================================================================== ;;; Establish control nodes that initiate action... ;;; Asserts an intention to execute a turnto-location action. (defeffector 1-turnto-location *agent-01* :r (==> (turnto-location ?x ?y ?z ?w) (upload-cmd turnto-location))) ;;; ============================================================================== ;;; Establish relationships between the control nodes... (deftopology *agent-01* :basic-agent :threshold-devices nil :simple-relays nil :pseudo-states (i_start i_stop) :lines (((i_start :pos (1-rotate/follow)) (1-rotate/follow :pos (1-turnto-location)) (1-turnto-location :pos (i_stop)))) :starts (i_start)) )