-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathghostdomain.pddl
More file actions
48 lines (40 loc) · 1.42 KB
/
ghostdomain.pddl
File metadata and controls
48 lines (40 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
(define (domain ghost)
(:requirements
:strips
)
(:predicates
(at ?x ?y) ;co-ordinates of ghost's position
(eaten ?p) ;whether or not a pacman has been eaten
(inc ?x1 ?x2) ;x-coordinate changes
(dec ?y1 ?y2) ;y-coordinate changes
(wall ?x ?y) ;wall co-ordinates
(pacmanat ?p ?x ?y) ;pacman's co-ordinates
)
;can only move in a certain direction if there are no walls, and if the x or y co-ordinate for the next
;position matches the direction moved
(:action move-right
:parameters (?x1 ?x2 ?y)
:precondition (and (at ?x1 ?y) (not (wall ?x2 ?y)) (inc ?x1 ?x2))
:effect (and (at ?x2 ?y) (not (at ?x1 ?y)))
)
(:action move-left
:parameters (?x1 ?x2 ?y)
:precondition (and (at ?x1 ?y) (not (wall ?x2 ?y)) (dec ?x1 ?x2))
:effect (and (at ?x2 ?y) (not (at ?x1 ?y)))
)
(:action move-up
:parameters (?x ?y1 ?y2)
:precondition (and (at ?x ?y1) (not (wall ?x ?y2)) (inc ?y1 ?y2))
:effect (and (at ?x ?y2) (not (at ?x ?y1)))
)
(:action move-down
:parameters (?x ?y1 ?y2)
:precondition (and (at ?x ?y1) (not (wall ?x ?y2)) (dec ?y1 ?y2))
:effect (and (at ?x ?y2) (not (at ?x ?y1)))
)
(:action eat
:parameters (?x ?y ?p)
:precondition (and (pacmanat ?p ?x ?y) (at ?x ?y))
:effect (and (eaten ?p) (not (pacmanat ?p ?x ?y)))
)
)