;; -*- lisp -*-
;; Test Civilian RuleSet
;; CommentOut Charactor is ';'
(
;; Initial Situation Posit
 (defposit init
   (defrule touhi1
     :condition (?know (and
			;; Civlian agent can act after 'time 3'
			(world :time *time :cond (> *time 3))
			(refuge :id *id :dist *dist)
			(self :position *hoge)
			(gsetq *refuge_id *id)))
     :activity 1
     :action (progn (setq *tmpdist (+ 100 (getdist *refuge_id *hoge)))
		    (print *tmpdist)
		    (!move :id *id)
		    (!remove init)
	     	    (!add goto_refuge))
     )
   )
 (defposit goto_refuge
   (defrule goto_refuge1
     :condition (?know (> *refuge_id 0))
     :activity 1
     :action (!move :id *refuge_id))
   (defrule touhi2
     :condition (?know (and
			;; if civilian is on the target refuge
			(self :position *id :cond (== *refuge_id *id))))
     :activity 2
                    ;; then say "What_a_relief!"
     :action (progn (!say :content What_a_relief!)
		    ;; and sleeping after
		    (!remove goto_refuge)
		    )
     )
   )
 )