-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththe_maze.pddl
195 lines (187 loc) · 5.18 KB
/
the_maze.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
; The aim of this problem is to get to the diamond to the point, j20
; This is a visual representation of the map of the maze (dots denote one way):
;
; j14 - j15
; | |
; | |
; | |
; j12 j13 j16
; | | |
; | | |
; | | |
; j1 --- j2 --- j4 ------ j7 --- j8 j17
; | ^ | ^ | ^ |
; | / | | | \ |
; | / | | | \ |
; j3 --- j5 --- j6 --- j9 --> j10 j18
; | |
; | |
; j11 j19 --- >**j20**
;
;
;
(define (problem theMaze) (:domain maze)
(:objects
ajan - Player
j1 j2 j3 j4 j5 j6 j7 j8 j9 j10 j11 j12 j13 j14 j15 j16 j17 j18 j19 j20 - Junction
dragon giant witch - Monster
i - Inventory
shield - Shield
box - Box
floor - Floor
tree - Platform
g1 g2 g3 - Gold
key - Key
banana apple strawberry - Food
sword axe knife - Weapon
diamond - Item
v v2 v3 - Vendor
)
(:init
(=(inventoryCount) 0)
(=(maxInventorySize) 20)
;Platform Levels
(=(platformLevel floor) 0)
(=(platformLevel box) 1)
(=(platformLevel tree) 2)
;normal direction
(isConnected j1 j2)
(= (distanceBetweenJunctions j1 j2) 1)
(isConnected j2 j3)
(= (distanceBetweenJunctions j2 j3) 1)
(isConnected j3 j4)
(= (distanceBetweenJunctions j3 j4) 1)
(isConnected j3 j5)
(= (distanceBetweenJunctions j3 j5) 1)
(isConnected j2 j4)
(= (distanceBetweenJunctions j2 j4) 1)
(isConnected j4 j5)
(= (distanceBetweenJunctions j4 j5) 1)
(isConnected j4 j7)
(= (distanceBetweenJunctions j4 j7) 1)
(isConnected j5 j6)
(= (distanceBetweenJunctions j5 j6) 1)
(isConnected j6 j7)
(= (distanceBetweenJunctions j6 j7) 1)
(isConnected j6 j9)
(= (distanceBetweenJunctions j6 j9) 1)
(isLocked j7 j12)
(= (distanceBetweenJunctions j7 j12) 1)
(isConnected j7 j8)
(= (distanceBetweenJunctions j7 j8) 1)
(isConnected j8 j9)
(= (distanceBetweenJunctions j8 j9) 1)
(isConnected j8 j13)
(= (distanceBetweenJunctions j8 j13) 1)
(isConnected j9 j10)
(= (distanceBetweenJunctions j9 j10) 1)
(isLocked j10 j11)
(= (distanceBetweenJunctions j10 j11) 1)
(isConnected j13 j14)
(= (distanceBetweenJunctions j13 j14) 1)
(isConnected j14 j15)
(= (distanceBetweenJunctions j14 j15) 1)
(isConnected j15 j16)
(= (distanceBetweenJunctions j15 j16) 1)
(isLocked j16 j17)
(= (distanceBetweenJunctions j16 j17) 1)
(isConnected j17 j18)
(= (distanceBetweenJunctions j17 j18) 1)
(isConnected j18 j19)
(= (distanceBetweenJunctions j18 j19) 1)
(isConnected j19 j20)
(= (distanceBetweenJunctions j19 j20) 1)
;other direction
(isConnected j2 j1)
(isConnected j3 j2)
(isConnected j4 j2)
(isConnected j5 j3)
(isConnected j5 j4)
(isConnected j7 j4)
(isConnected j6 j5)
(isConnected j12 j7)
(isConnected j8 j7)
(isConnected j9 j6)
(isConnected j9 j8)
(isConnected j10 j8)
(isConnected j11 j10)
(isConnected j13 j8)
(isConnected j14 j13)
(isConnected j15 j14)
(isConnected j16 j15)
(isConnected j17 j16)
(isConnected j18 j17)
(isConnected j19 j18)
;player
(atLocation ajan j1)
(=(playerHealth) 100)
(on ajan floor)
;v1
(atLocation v j3)
(sellItem v sword)
(=(weaponDamage sword) 30)
;v2
(atLocation v2 j8)
(sellItem v2 axe)
(=(weaponDamage axe) 30)
;v3
(atLocation v3 j13)
(sellItem v3 knife)
(=(weaponDamage knife) 30)
;diamond
(atLocation diamond j12)
(on diamond floor)
;banana
(atLocation banana j4)
(on banana tree)
(=(foodValue banana) 50)
;apple
(atLocation apple j5)
(on apple box)
(=(foodValue apple) 50)
;
(atLocation strawberry j6)
(on strawberry floor)
(=(foodValue strawberry) 50)
;gold1
(atLocation g1 j2)
(on g1 floor)
;gold2
(atLocation g2 j9)
(on g2 floor)
;gold3
(atLocation g3 j11)
(on g3 floor)
;box
(atLocation box j5)
(on box floor)
;tree
(atLocation tree j4)
;monster
(not(isMonsterDead dragon))
(=(monstersSlain) 0) ;without this it doesnt work
(=(monsterHealth dragon) 20)
(=(monsterStrength dragon) 50)
(atLocation dragon j16)
(on dragon floor)
;monster2
(not(isMonsterDead giant))
(=(monsterHealth giant) 20)
(=(monsterStrength giant) 50)
(atLocation giant j7)
(on giant floor)
;monster3
(not(isMonsterDead witch))
(=(monsterHealth witch) 20)
(=(monsterStrength witch) 50)
(atLocation witch j10)
(on witch floor)
)
(:goal (and
(atLocation ajan j20)
(atLocation diamond j20)
(isMonsterDead dragon)
(isMonsterDead giant)
(isMonsterDead witch)
))
)