You are not logged in. login register
Game vacuumcleaner_random_big
name vacuumcleaner_random_big
creator stephan
number of roles 2
stylesheet vacuumcleaner/vacuumcleaner.xsl
GDL v2
enabled
matches show matches
statistics show game statistics
description a bigger vacuum cleaner world

Game Description

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 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 7))
(init (at dirt 2 4))
(init (at dirt 3 10))
(init (at dirt 4 1))
(init (at dirt 5 5))
(init (at dirt 6 2))
(init (at dirt 7 9))
(init (at dirt 8 9))
(init (at dirt 9 3))
(init (at dirt 10 1))
(init (step 0))
(init (points 50))

(<= (legal random (setup_agent ?x ?y ?o))
    (true (step 0))
	(xcoordinate ?x)
	(ycoordinate ?y)
	(direction ?o)
)

(<= (legal random noop)
    (not (true (step 0)))
)

;; 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)
   (not (true (step 0)))
)

;; 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))
	(not (does agent turn_off))
    (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 15 ?y)
)

(<= (next (points ?y))
    (true (points ?x))
	(does agent turn_off)
	(true (home ?m ?n))
	(true (at agent ?m ?n))
    (minus ?x 1 ?y)
)

(<= (next (points ?y))
    (true (points ?x))
	(does agent turn_off)
	(true (home ?m ?n))
	(not (true (at agent ?m ?n)))
    (minus ?x 25 ?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
	(maxnumber ?m)
	(true (step ?m))
)

(goal random 0)

(<= (goal agent ?p)
	(true (points ?p))
	(true stopped)
)

(<= (goal agent ?p1)
	(not (true stopped))
	(true (points ?p))
	(minus ?p 25 ?p1)
)

;; auxiliary
(<= (next_position ?x ?y)
	(does random (setup_agent ?x ?y ?o))
)

(<= (next_position ?m ?n)
   (does agent go)
   (not facing_wall)
   (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)))

(<= (trajectory ?m ?n ?o ?m ?n)
   (xcoordinate ?m)
   (ycoordinate ?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)
   (xcoordinate ?m))
(<= (adjacent ?m ?i south ?m ?j)
   (succ ?j ?i)
   (xcoordinate ?m))
(<= (adjacent ?i ?n east ?j ?n)
   (succ ?i ?j)
   (ycoordinate ?n))
(<= (adjacent ?i ?n west ?j ?n)
   (succ ?j ?i)
   (ycoordinate ?n))

(<= facing_wall
   (true (at agent ?m ?n))
   (size ?width ?n)
   (true (orientation north)))
(<= facing_wall
   (true (at agent ?m 1))
   (true (orientation south)))
(<= facing_wall
   (true (at agent ?m ?n))
   (size ?m ?height)
   (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)

(xcoordinate 1)
(xcoordinate 2)
(xcoordinate 3)
(xcoordinate 4)
(xcoordinate 5)
(xcoordinate 6)
(xcoordinate 7)
(xcoordinate 8)
(xcoordinate 9)
(xcoordinate 10)

(ycoordinate 1)
(ycoordinate 2)
(ycoordinate 3)
(ycoordinate 4)
(ycoordinate 5)
(ycoordinate 6)
(ycoordinate 7)
(ycoordinate 8)
(ycoordinate 9)
(ycoordinate 10)

(size 10 10)

(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)
(succ 100 101)
(succ 101 102)
(succ 102 103)
(succ 103 104)
(succ 104 105)
(succ 105 106)
(succ 106 107)
(succ 107 108)
(succ 108 109)
(succ 109 110)
(succ 110 111)
(succ 111 112)
(succ 112 113)
(succ 113 114)
(succ 114 115)
(succ 115 116)
(succ 116 117)
(succ 117 118)
(succ 118 119)
(succ 119 120)
(succ 120 121)
(succ 121 122)
(succ 122 123)
(succ 123 124)
(succ 124 125)
(succ 125 126)
(succ 126 127)
(succ 127 128)
(succ 128 129)
(succ 129 130)
(succ 130 131)
(succ 131 132)
(succ 132 133)
(succ 133 134)
(succ 134 135)
(succ 135 136)
(succ 136 137)
(succ 137 138)
(succ 138 139)
(succ 139 140)
(succ 140 141)
(succ 141 142)
(succ 142 143)
(succ 143 144)
(succ 144 145)
(succ 145 146)
(succ 146 147)
(succ 147 148)
(succ 148 149)
(succ 149 150)
(succ 150 151)
(succ 151 152)
(succ 152 153)
(succ 153 154)
(succ 154 155)
(succ 155 156)
(succ 156 157)
(succ 157 158)
(succ 158 159)
(succ 159 160)
(succ 160 161)
(succ 161 162)
(succ 162 163)
(succ 163 164)
(succ 164 165)
(succ 165 166)
(succ 166 167)
(succ 167 168)
(succ 168 169)
(succ 169 170)
(succ 170 171)
(succ 171 172)
(succ 172 173)
(succ 173 174)
(succ 174 175)
(succ 175 176)
(succ 176 177)
(succ 177 178)
(succ 178 179)
(succ 179 180)
(succ 180 181)
(succ 181 182)
(succ 182 183)
(succ 183 184)
(succ 184 185)
(succ 185 186)
(succ 186 187)
(succ 187 188)
(succ 188 189)
(succ 189 190)
(succ 190 191)
(succ 191 192)
(succ 192 193)
(succ 193 194)
(succ 194 195)
(succ 195 196)
(succ 196 197)
(succ 197 198)
(succ 198 199)
(succ 199 200)

(maxnumber 200)

(number 0)
(<= (number ?y)
    (succ ?x ?y)
)

(<= (plus ?x 0 ?x)
        (number ?x)
)
(<= (plus ?m ?x ?m)
	(maxnumber ?m)
	(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)
)

sees_XML(...) rules

(<= (sees_xml random ?t) (sees_xml1 ?t))
(<= (sees_xml ?p ?t) (role ?p) (distinct ?p random) (sees_xml1 ?t))

(<= (sees_xml1 (cell ?x ?y b))
    (xcoordinate ?x)
    (ycoordinate ?y)
    (not (true (at ?what ?x ?y)))
)
(<= (sees_xml1 (cell ?x ?y x))
    (true (at obstacle ?x ?y))
)
(<= (sees_xml1 (cell ?x ?y whitepawn))
    (true (at agent ?x ?y))
    (not (true (at dirt ?x ?y)))
)
(<= (sees_xml1 (cell ?x ?y blackpawn))
    (true (at dirt ?x ?y))
    (true (at agent ?x ?y))
)
(<= (sees_xml1 (cell ?x ?y brown_disc))
    (true (at dirt ?x ?y))
    (not (true (at agent ?x ?y)))
)
(<= (sees_xml1 stopped)
    (true stopped)
)
(<= (sees_xml1 (orientation ?x))
    (true (orientation ?x))
)
(<= (sees_xml1 (cell ?x ?y x))
    (true (at wall ?x ?y))
)
(<= (sees_xml1 (points ?x))
    (true (points ?x))
)
(<= (sees_xml1 (home ?x ?y))
    (true (home ?x ?y))
)
(<= (sees_xml1 (step ?x))
    (true (step ?x))
)
(<= (sees_xml1 (size ?x ?y))
    (size ?x ?y)
)