-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain.pddl
114 lines (82 loc) · 2.87 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
(define (domain Dungeon)
(:requirements
:typing
:negative-preconditions
)
(:types
swords cells
)
(:predicates
;Hero's cell location
(at-hero ?loc - cells)
;Sword cell location
(at-sword ?s - swords ?loc - cells)
;Indicates if a cell location has a monster
(has-monster ?loc - cells)
;Indicates if a cell location has a trap
(has-trap ?loc - cells)
;Indicates if a chell or sword has been destroyed
(is-destroyed ?obj)
;connects cells
(connected ?from ?to - cells)
;Hero's hand is free
(arm-free)
;Hero's holding a sword
(holding ?s - swords)
;It becomes true when a trap is disarmed
(trap-disarmed ?loc)
)
;Hero can move if the
; - hero is at current location
; - cells are connected,
; - there is no trap in current loc, and
; - destination does not have a trap/monster/has-been-destroyed
;Effects move the hero, and destroy the original cell. No need to destroy the sword.
(:action move
:parameters (?from ?to - cells)
:precondition (and
)
:effect (and
)
)
;When this action is executed, the hero gets into a location with a trap
(:action move-to-trap
:parameters (?from ?to - cells)
:precondition (and
)
:effect (and
)
)
;When this action is executed, the hero gets into a location with a monster
(:action move-to-monster
:parameters (?from ?to - cells ?s - swords)
:precondition (and
)
:effect (and
)
)
;Hero picks a sword if he's in the same location
(:action pick-sword
:parameters (?loc - cells ?s - swords)
:precondition (and
)
:effect (and
)
)
;Hero destroys his sword.
(:action destroy-sword
:parameters (?loc - cells ?s - swords)
:precondition (and
)
:effect (and
)
)
;Hero disarms the trap with his free arm
(:action disarm-trap
:parameters (?loc - cells)
:precondition (and
)
:effect (and
)
)
)