forked from potassco/pddl-instances
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdomain.pddl
93 lines (90 loc) · 2.22 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
(define (domain snake)
(:requirements :strips :negative-preconditions)
(:constants
dummypoint
)
(:predicates
;up down left right of a field
(ISADJACENT ?x ?y)
;the last field of the snake
(tailsnake ?x)
;the first field of the snake
(headsnake ?x)
;pieces of the snake that are connected. from front to back
(nextsnake ?x ?y)
;a field that is occupied by the snake or by an obstacle
(blocked ?x)
;next point that will spawn
(spawn ?x)
;point y will spawn after point x
(NEXTSPAWN ?x ?y)
;a field that has a point that can be collected by the snake
(ispoint ?x)
)
(:action move
:parameters (?head ?newhead ?tail ?newtail)
:precondition
(and
(headsnake ?head)
(ISADJACENT ?head ?newhead)
(tailsnake ?tail)
(nextsnake ?newtail ?tail)
(not (blocked ?newhead))
(not (ispoint ?newhead))
)
:effect
(and
(blocked ?newhead)
(headsnake ?newhead)
(nextsnake ?newhead ?head)
(not (headsnake ?head))
(not (blocked ?tail))
(not (tailsnake ?tail))
(not (nextsnake ?newtail ?tail))
(tailsnake ?newtail)
)
)
(:action move-and-eat-spawn
:parameters (?head ?newhead ?spawnpoint ?nextspawnpoint)
:precondition
(and
(headsnake ?head)
(ISADJACENT ?head ?newhead)
(not (blocked ?newhead))
(ispoint ?newhead)
(spawn ?spawnpoint)
(NEXTSPAWN ?spawnpoint ?nextspawnpoint)
(not (= ?spawnpoint dummypoint))
)
:effect
(and
(blocked ?newhead)
(headsnake ?newhead)
(nextsnake ?newhead ?head)
(not (headsnake ?head))
(not (ispoint ?newhead))
(ispoint ?spawnpoint)
(not (spawn ?spawnpoint))
(spawn ?nextspawnpoint)
)
)
(:action move-and-eat-no-spawn
:parameters (?head ?newhead)
:precondition
(and
(headsnake ?head)
(ISADJACENT ?head ?newhead)
(not (blocked ?newhead))
(ispoint ?newhead)
(spawn dummypoint)
)
:effect
(and
(blocked ?newhead)
(headsnake ?newhead)
(nextsnake ?newhead ?head)
(not (headsnake ?head))
(not (ispoint ?newhead))
)
)
)