-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkill_monster.pddl
73 lines (63 loc) · 1.6 KB
/
kill_monster.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
; The aim of this problem is to kill the monster at j2 and proceed to the final location, j3
; using the weapons available at j1
(define (problem problem_kill_monster)
(:domain maze)
(:objects
j1 j2 j3 - Junction
tyrion - Player
dragon - Monster
basilisk - Monster
i - Inventory
shield - Shield
b - Box
f - Floor
g - Gold
key - Key
banana - Food
sword - Weapon
axe - Weapon
v - Vendor
)
(:init
(isConnected j1 j2)
(= (distanceBetweenJunctions j1 j2) 1)
(isConnected j2 j1)
(isConnected j2 j3)
(isConnected j3 j2)
(= (distanceBetweenJunctions j2 j3) 1)
;Player
(=(playerHealth) 30)
(atLocation tyrion j1)
(on tyrion f) ;player on the floor initially so they can move between the junctions
(=(inventoryCount) 0)
(=(maxInventorySize) 5)
;Monsters
(not(isMonsterDead dragon))
(=(monstersSlain) 0) ;without this it doesnt work
(=(monsterHealth dragon) 20)
(=(monsterStrength dragon) 20)
(atLocation dragon j2)
(on dragon f)
(not(isMonsterDead basilisk))
(=(monsterHealth basilisk) 20)
(=(monsterStrength basilisk) 20)
(atLocation basilisk j2)
(on basilisk f)
;Weapons
(=(weaponDamage sword) 30)
(atLocation sword j1)
(on sword f) ;sword on the floor so player can pickup
(=(weaponDamage axe) 20)
(atLocation axe j1)
(on axe f)
;food
(atLocation banana j1)
(=(foodValue banana) 20)
(on banana f )
)
(:goal (and
(not(carryItem tyrion banana))
(not(atLocation banana j1))
(isMonsterDead dragon) (isMonsterDead basilisk)
(atLocation tyrion j3)))
)