User Tools

Site Tools


public:t-622-arti-12-1:lab_1_-_agents

This is an old revision of the document!


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Vacuum cleaner world ;; ;; Author: Stephan Schiffel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Fluents ;;;;;;;;;; ;; at(?x,?m,?n) ?x :: agent | wall | dirt ;; ?m,?n :: 1 | 2 | 3 | 4 | … ;; orientation(?o) ?o :: north | south | east | west ;; stopped ;; step(?x) ?x :: 1 | 2 | 3 | … | 60 ;; ;; Actions ;;;;;;;;;; ;; turn_on; go; turn_left; turn_right; suck; turn_off ;; ;; Percepts ;;;;;;;;;;; ;; bump; dirt ;;

;; roles and initial state

(role agent) (role random)

(init (at dirt 1 3)) (init (at dirt 2 4)) (init (at dirt 4 1)) (init (at dirt 3 2)) (init (at dirt 5 5)) (init (step 0)) (init (points 50))

(⇐ (legal random (setup_agent ?x ?y ?o))

  (true (step 0))
(coordinate ?x)
(coordinate ?y)
(direction ?o)

)

(⇐ (legal random (add_dirt ?x ?y))

  (true (step ?s))
(distinct ?s 0)
(smaller ?s 6)
(coordinate ?x)
(coordinate ?y)

)

(⇐ (legal random noop)

  (true (step ?s))
(smaller 5 ?s)

)

;; action preconditions

(⇐ (legal agent turn_on)

 (true (step 0))

) (⇐ (legal agent go)

 (not (true (step 0)))

) (⇐ (legal agent turn_left)

 (not (true (step 0)))

) (⇐ (legal agent turn_right)

 (not (true (step 0)))

) (⇐ (legal agent suck)

 (true (at agent ?m ?n))
 ; (true (at dirt ?m ?n))

) (⇐ (legal agent turn_off)

 (true (at agent 1 1))

)

;; home location

(⇐ (next (home ?x ?y))

(true (home ?x ?y))

)

(⇐ (next (home ?x ?y))

(does random (setup_agent ?x ?y ?o))

)

;; action effects

(⇐ (next (at agent ?m ?n))

 (next_position ?m ?n)

)

(⇐ (next (orientation ?o))

 (does random (setup_agent ?x ?y ?o))

)

(⇐ (next (orientation ?o))

 (does agent turn_left)
 (true (orientation ?p))
 (clockwise ?o ?p)

)

(⇐ (next (orientation ?o))

 (does agent turn_right)
 (true (orientation ?p))
 (clockwise ?p ?o)

)

(⇐ (next (orientation ?o))

 (true (orientation ?o))
 (not (does agent turn_left))
 (not (does agent turn_right))

)

(⇐ (next (at dirt ?m ?n))

 (true (at dirt ?m ?n))
 (not (does agent suck))

)

(⇐ (next (at dirt ?m ?n))

(true (at dirt ?m ?n))
(does agent suck)
(true (at agent ?m1 ?n1))
(distinct ?m1 ?m)

) (⇐ (next (at dirt ?m ?n))

(true (at dirt ?m ?n))
(does agent suck)
(true (at agent ?m1 ?n1))
(distinct ?n1 ?n)

)

(⇐ (next stopped)

 (does agent turn_off)

)

(⇐ (next (at wall ?m ?n))

 (true (at wall ?m ?n))

)

;; step counter

(⇐ (next (step ?y))

  (true (step ?x))
  (succ ?x ?y)

)

;; points

(⇐ (next (points ?y))

  (true (points ?x))
(not (does agent suck))
  (minus ?x 1 ?y)

)

(⇐ (next (points ?y))

  (true (points ?x))
(does agent suck)
(true (at agent ?m ?n))
(not (true (at dirt ?m ?n)))
  (minus ?x 5 ?y)

)

(⇐ (next (points ?y))

  (true (points ?x))
(does agent suck)
(true (at agent ?m ?n))
(true (at dirt ?m ?n))
  (plus ?x 10 ?y)

)

;; percepts

(⇐ (sees agent dirt)

 (next_position ?m ?n)
 (true (at dirt ?m ?n))
 (not (does agent suck))

)

(⇐ (sees agent bump)

 is_bumping

)

(⇐ is_bumping

 (does agent go)
 facing_wall

)

;; termination & goal

(⇐ terminal

 (true stopped)

)

(⇐ terminal

(true (step 100))

)

(goal random 0)

(⇐ (goal agent ?p)

(true (points ?p))
(true stopped)
(not dirty)

)

(⇐ (goal agent 0)

(not (true stopped))

)

(⇐ (goal agent 0)

dirty

)

(⇐ dirty

(true (at dirt ?x ?y))

)

;; auxiliary (⇐ (next_position ?x ?y)

(does random (setup_agent ?x ?y ?o))

)

(⇐ (next_position ?m ?n)

 (does agent go)
 (true (at agent ?i ?j))
 (true (orientation ?o))
 (adjacent ?i ?j ?o ?m ?n))

(⇐ (next_position ?m ?n)

 (does agent go)
 facing_wall
 (true (at agent ?m ?n)))

(⇐ (next_position ?m ?n)

 (not (does agent go))
 (true (at agent ?m ?n)))

(⇐ (next_to ?x ?m ?n)

 (true (at ?x ?i ?j))
 (adjacent ?m ?n ?o ?i ?j))

(⇐ (trajectory ?m ?n ?o ?m ?n)

 (coordinate ?m)
 (coordinate ?n)
 (direction ?o))

(⇐ (trajectory ?i ?j ?o ?m ?n)

 (adjacent ?i ?j ?o ?k ?l)
 (trajectory ?k ?l ?o ?m ?n))

(⇐ (adjacent ?m ?i north ?m ?j)

 (succ ?i ?j)
 (coordinate ?m))

(⇐ (adjacent ?m ?i south ?m ?j)

 (succ ?j ?i)
 (coordinate ?m))

(⇐ (adjacent ?i ?n east ?j ?n)

 (succ ?i ?j)
 (coordinate ?n))

(⇐ (adjacent ?i ?n west ?j ?n)

 (succ ?j ?i)
 (coordinate ?n))

(⇐ facing_wall

 (true (at agent ?m ?n))
 (max ?n)
 (true (orientation north)))

(⇐ facing_wall

 (true (at agent ?m 1))
 (true (orientation south)))

(⇐ facing_wall

 (true (at agent ?m ?n))
 (max ?m)
 (true (orientation east)))

(⇐ facing_wall

 (true (at agent 1 ?n))
 (true (orientation west)))

(direction north) (direction south) (direction east) (direction west)

(clockwise north east) (clockwise east south) (clockwise south west) (clockwise west north)

(coordinate 1) (coordinate 2) (coordinate 3) (coordinate 4) (coordinate 5)

(succ 1 2) (succ 2 3) (succ 3 4) (succ 4 5)

(max 5)

(succ 0 1) (succ 1 2) (succ 2 3) (succ 3 4) (succ 4 5) (succ 5 6) (succ 6 7) (succ 7 8) (succ 8 9) (succ 9 10) (succ 10 11) (succ 11 12) (succ 12 13) (succ 13 14) (succ 14 15) (succ 15 16) (succ 16 17) (succ 17 18) (succ 18 19) (succ 19 20) (succ 20 21) (succ 21 22) (succ 22 23) (succ 23 24) (succ 24 25) (succ 25 26) (succ 26 27) (succ 27 28) (succ 28 29) (succ 29 30) (succ 30 31) (succ 31 32) (succ 32 33) (succ 33 34) (succ 34 35) (succ 35 36) (succ 36 37) (succ 37 38) (succ 38 39) (succ 39 40) (succ 40 41) (succ 41 42) (succ 42 43) (succ 43 44) (succ 44 45) (succ 45 46) (succ 46 47) (succ 47 48) (succ 48 49) (succ 49 50) (succ 50 51) (succ 51 52) (succ 52 53) (succ 53 54) (succ 54 55) (succ 55 56) (succ 56 57) (succ 57 58) (succ 58 59) (succ 59 60) (succ 60 61) (succ 61 62) (succ 62 63) (succ 63 64) (succ 64 65) (succ 65 66) (succ 66 67) (succ 67 68) (succ 68 69) (succ 69 70) (succ 70 71) (succ 71 72) (succ 72 73) (succ 73 74) (succ 74 75) (succ 75 76) (succ 76 77) (succ 77 78) (succ 78 79) (succ 79 80) (succ 80 81) (succ 81 82) (succ 82 83) (succ 83 84) (succ 84 85) (succ 85 86) (succ 86 87) (succ 87 88) (succ 88 89) (succ 89 90) (succ 90 91) (succ 91 92) (succ 92 93) (succ 93 94) (succ 94 95) (succ 95 96) (succ 96 97) (succ 97 98) (succ 98 99) (succ 99 100)

(number 0) (⇐ (number ?y)

      (succ ?x ?y)

)

(⇐ (plus ?x 0 ?x)

      (number ?x)

) (⇐ (plus 100 ?x 100)

(number ?x)

) (⇐ (plus ?x ?y ?sum)

(succ ?x ?x1)
(succ ?y1 ?y)
(plus ?x1 ?y1 ?sum)

)

(⇐ (minus ?x 0 ?x)

      (number ?x)

) (⇐ (minus 0 ?x 0)

(number ?x)

) (⇐ (minus ?x ?y ?sum)

(succ ?x1 ?x)
(succ ?y1 ?y)
(minus ?x1 ?y1 ?sum)

)

(⇐ (smaller ?x ?y)

      (succ ?x ?y)

) (⇐ (smaller ?x ?y)

      (succ ?z ?y)
      (smaller ?x ?z)

)

/var/www/cadia.ru.is/wiki/data/attic/public/t-622-arti-12-1/lab_1_-_agents.1326993407.txt.gz · Last modified: 2024/04/29 13:32 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki