-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain2.pddl
146 lines (130 loc) · 3.77 KB
/
domain2.pddl
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
(define (domain waiting)
(:requirements :adl )
(:types
waiter
location
customer
plate broom - item
brokenPlate
droppedFood
)
(:constants
;; You should not need to add any additional constants
Agent - waiter
BTA - location
)
(:predicates
(Adjacent ?x - location ?y - location)
(At ?x - object ?y - location)
(HasFood ?p - plate)
(Holding ?a - waiter ?i - item)
(Served ?c - customer)
(EmptyHanded ?a - waiter)
)
(:action pickplate
:parameters (?p - plate ?x - location)
:precondition (and
(At Agent ?x)
(At ?p ?x)
(not (exists (?i - item) (Holding Agent ?i)))
(EmptyHanded Agent)
)
:effect (and
(Holding Agent ?p)
(not (EmptyHanded Agent))
)
)
(:action pickbroom
:parameters (?b - broom ?x - location)
:precondition (and
(At agent ?x)
(At ?b ?x)
(not (exists (?i - item) (Holding Agent ?i)))
)
:effect (and
(Holding Agent ?b)
)
)
(:action present
:parameters (?p - plate ?c - customer ?x - location)
:precondition (and
(At Agent ?x)
(At ?c ?x)
(Holding Agent ?p)
(HasFood ?p)
(not (EmptyHanded Agent))
)
:effect (and
(Served ?c)
(not (Holding Agent ?p))
(EmptyHanded Agent)
)
)
(:action fill
:parameters (?p - plate)
:precondition (and
(At Agent BTA)
(not (HasFood ?p))
(Holding Agent ?p)
)
:effect (and
(HasFood ?p)
)
)
(:action move
:parameters (?x - location ?y - location)
:precondition (and
(At Agent ?x)
(not (At Agent ?y))
(or (Adjacent ?x ?y) (Adjacent ?y ?x))
(not (exists (?bp - brokenPlate) (At ?bp ?y))) ; Agent cannot move if it contains a broken plate
)
:effect (and
(At Agent ?y)
(not (At Agent ?x))
)
)
(:action sweepplate
:parameters (?bp - brokenPlate ?x - location ?y - location)
:precondition (and
(At ?bp ?x) ;If the location x has both, robot sweeps it up in one action
(At Agent ?y)
(or (Adjacent ?x ?y) (Adjacent ?y ?x))
(exists (?b - broom) (Holding Agent ?b))
(not (exists (?p - plate) (Holding Agent ?p)))
(EmptyHanded Agent)
)
:effect (and
(not (At ?bp ?x))
(not (EmptyHanded Agent))
)
)
(:action sweepfood
:parameters (?df - droppedFood ?x - location ?y - location)
:precondition (and
(At ?df ?x) ;If the location x has both, robot sweeps it up in one action
(At Agent ?y)
(or (Adjacent ?x ?y) (Adjacent ?y ?x))
(exists (?b - broom) (Holding Agent ?b))
(not (exists (?p - plate) (Holding Agent ?p)))
(EmptyHanded Agent)
)
:effect (and
(not (At ?df ?x))
(not (EmptyHanded Agent))
)
)
(:action putdown
:parameters (?i - item ?x - location)
:precondition (and
(Holding Agent ?i)
(At Agent ?x)
(not (EmptyHanded Agent))
)
:effect (and
(not (Holding Agent ?i))
(At ?i ?x)
(EmptyHanded Agent)
)
)
)