-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdomain-4.pddl
148 lines (120 loc) · 4.62 KB
/
domain-4.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
(define (domain supermarket)
(:requirements :adl:fluents)
(:types
location aisleCell shelves weighingScale checkoutStand basketStack topUpStation - location
shopbot item basket - object
)
(:predicates
(connected ?from - aisleCell ?to - aisleCell)
(adjacent ?from - aisleCell ?to - location)
(at-shopbot ?shopbot - shopbot ?cell - aisleCell)
(holding ?shopbot - shopbot ?obj - basket)
(weighable ?item - item)
(weighed ?item - item)
(in ?obj - object ?loc - location)
(checkout ?item - item ?shopbot - shopbot)
(not-empty-basket ?item - item ?basket - basket)
(empty ?basket - basket)
(cell-occupied ?cell - aisleCell)
(assigned ?basket - basket ?shopbot - shopbot)
)
(:functions
(price ?item - item)
(balance ?shopbot - shopbot)
)
(:constants
aisleCell - location
shelves -location
weighingScale - location
checkoutStand -location
basketStack - location;; New constant for basket stack location
topUpStation - location
)
(:action move
:parameters (?shopbot - shopbot ?from ?to - aisleCell)
:precondition (and
(at-shopbot ?shopbot ?from)
(connected ?from ?to)
(not(cell-occupied ?to ))
)
:effect (and
(not (at-shopbot ?shopbot ?from))
(at-shopbot ?shopbot ?to)
(forall (?other - shopbot) (when (not (= ?other ?shopbot)) (not(cell-occupied ?to))))
)
)
(:action pickUp
:parameters (?shopbot - shopbot ?item - item ?from - aisleCell ?loc - location ?basket - basket)
:precondition (and
(adjacent ?from ?loc)
(in ?item ?loc)
(at-shopbot ?shopbot ?from)
(holding ?shopbot ?basket)
(not (not-empty-basket ?item ?basket)))
:effect (and (not-empty-basket ?item ?basket)
(not (in ?item ?loc))
(not (empty ?basket)))
)
(:action drop
:parameters (?shopbot - shopbot ?item - item ?from - aisleCell ?loc - location ?basket - basket)
:precondition (and
(not-empty-basket ?item ?basket)
(at-shopbot ?shopbot ?from)
(adjacent ?from ?loc)
(not (in ?item ?loc)))
:effect (and (in ?item ?loc)
(not (not-empty-basket ?item ?basket)) )
)
(:action weigh
:parameters (?shopbot - shopbot ?item - item ?cell - aisleCell ?ws - weighingScale ?basket - basket)
:precondition (and (holding ?shopbot ?basket)
(not-empty-basket ?item ?basket)
(at-shopbot ?shopbot ?cell)
(adjacent ?cell ?ws)
(weighable ?item)
(not (weighed ?item)))
:effect (and (weighed ?item)
(not (not-empty-basket ?item ?basket))
(in ?item ?ws))
)
(:action checkout-item-with-credits
:parameters (?shopbot - shopbot ?item - item ?basket - basket ?cell - aisleCell ?cs - checkoutStand)
:precondition (and (not (holding ?shopbot ?basket))
(not (not-empty-basket ?item ?basket))
(at-shopbot ?shopbot ?cell)
(adjacent ?cell ?cs)
(>= (balance ?shopbot) (price ?item)))
:effect (and (checkout ?item ?shopbot )
(decrease (balance ?shopbot) (price ?item))
(not (not-empty-basket ?item ?basket)))
)
(:action pickUpBasket
:parameters (?shopbot - shopbot ?basket - basket ?cell - aisleCell ?bs - basketStack)
:precondition (and
(at-shopbot ?shopbot ?cell)
(adjacent ?cell ?bs)
(in ?basket ?bs)
(not (holding ?shopbot ?basket)))
:effect (and (holding ?shopbot ?basket)
(not (in ?basket ?bs))
(empty ?basket)(assigned ?basket ?shopbot))
)
(:action checkoutWithBasket
:parameters (?shopbot - shopbot ?basket - basket ?cell - aisleCell ?cs - checkoutStand)
:precondition (and
(holding ?shopbot ?basket)
(at-shopbot ?shopbot ?cell)
(adjacent ?cell ?cs)
(assigned ?basket ?shopbot)
(forall(?item -item)
(not (not-empty-basket ?item ?basket))))
:effect (and
(not (holding ?shopbot ?basket))
(not(assigned ?basket ?shopbot))
(in ?basket ?cs)))
(:action top-up-credits
:parameters (?shopbot - shopbot ?cell - aisleCell ?tu - topUpStation)
:precondition (and (at-shopbot ?shopbot ?cell) (adjacent ?cell ?tu))
:effect (increase (balance ?shopbot) 5)
)
)