-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathdomain.pddl
145 lines (134 loc) · 4.36 KB
/
domain.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
;; Cave Diving ADL
;; Authors: Nathan Robinson,
;; Christian Muise, and
;; Charles Gretton
(define (domain cave-diving-adl)
(:requirements :typing :action-costs :adl)
(:types location diver tank quantity)
(:predicates
(at-tank ?t - tank ?l - location)
(in-storage ?t - tank)
(full ?t - tank)
(next-tank ?t1 - tank ?t2 - tank)
(at-diver ?d - diver ?l - location)
(available ?d - diver)
(at-surface ?d - diver)
(decompressing ?d - diver)
(precludes ?d1 - diver ?d2 - diver)
(cave-entrance ?l - location)
(connected ?l1 - location ?l2 - location)
(next-quantity ?q1 - quantity ?q2 - quantity)
(holding ?d - diver ?t - tank)
(capacity ?d - diver ?q - quantity)
(have-photo ?l - location)
(in-water )
)
(:functions
(hiring-cost ?d - diver) - number
(other-cost) - number
(total-cost) - number
)
(:action hire-diver
:parameters (?d1 - diver)
:precondition (and (available ?d1)
(not (in-water))
)
:effect (and (at-surface ?d1)
(not (available ?d1))
(forall (?d2 - diver)
(when (precludes ?d1 ?d2) (not (available ?d2))))
(in-water)
(increase (total-cost) (hiring-cost ?d1))
)
)
(:action prepare-tank
:parameters (?d - diver ?t1 ?t2 - tank ?q1 ?q2 - quantity)
:precondition (and (at-surface ?d)
(in-storage ?t1)
(next-quantity ?q1 ?q2)
(capacity ?d ?q2)
(next-tank ?t1 ?t2)
)
:effect (and (not (in-storage ?t1))
(not (capacity ?d ?q2))
(in-storage ?t2)
(full ?t1)
(capacity ?d ?q1)
(holding ?d ?t1)
(increase (total-cost) (other-cost ))
)
)
(:action enter-water
:parameters (?d - diver ?l - location)
:precondition (and (at-surface ?d)
(cave-entrance ?l)
)
:effect (and (not (at-surface ?d))
(at-diver ?d ?l)
(increase (total-cost) (other-cost ))
)
)
(:action pickup-tank
:parameters (?d - diver ?t - tank ?l - location ?q1 ?q2 - quantity)
:precondition (and (at-diver ?d ?l)
(at-tank ?t ?l)
(next-quantity ?q1 ?q2)
(capacity ?d ?q2)
)
:effect (and (not (at-tank ?t ?l))
(not (capacity ?d ?q2))
(holding ?d ?t)
(capacity ?d ?q1)
(increase (total-cost) (other-cost ))
)
)
(:action drop-tank
:parameters (?d - diver ?t - tank ?l - location ?q1 ?q2 - quantity)
:precondition (and (at-diver ?d ?l)
(holding ?d ?t)
(next-quantity ?q1 ?q2)
(capacity ?d ?q1)
)
:effect (and (not (holding ?d ?t))
(not (capacity ?d ?q1))
(at-tank ?t ?l)
(capacity ?d ?q2)
(increase (total-cost) (other-cost ))
)
)
(:action swim
:parameters (?d - diver ?t - tank ?l1 ?l2 - location)
:precondition (and (at-diver ?d ?l1)
(holding ?d ?t)
(full ?t)
(connected ?l1 ?l2)
)
:effect (and (not (at-diver ?d ?l1))
(not (full ?t))
(at-diver ?d ?l2)
(increase (total-cost) (other-cost ))
)
)
(:action photograph
:parameters (?d - diver ?l - location ?t - tank)
:precondition (and (at-diver ?d ?l)
(holding ?d ?t)
(full ?t)
)
:effect (and (not (full ?t))
(have-photo ?l)
(increase (total-cost) (other-cost ))
)
)
(:action decompress
:parameters (?d - diver ?l - location)
:precondition (and (at-diver ?d ?l)
(cave-entrance ?l)
)
:effect (and (not (at-diver ?d ?l))
(decompressing ?d)
(not (in-water))
(increase (total-cost) (other-cost ))
)
)
)