forked from potassco/pddl-instances
-
Notifications
You must be signed in to change notification settings - Fork 1
/
domain.pddl
81 lines (65 loc) · 2.31 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
;;Created by Tomas de la Rosa
;;Domain for painting floor tiles with two colors
(define (domain floor-tile)
(:requirements :typing)
(:types robot tile color - object)
(:predicates
(robot-at ?r - robot ?x - tile)
(up ?x - tile ?y - tile)
(down ?x - tile ?y - tile)
(right ?x - tile ?y - tile)
(left ?x - tile ?y - tile)
(clear ?x - tile)
(painted ?x - tile ?c - color)
(robot-has ?r - robot ?c - color)
(available-color ?c - color)
(free-color ?r - robot))
(:functions (total-cost))
(:action change-color
:parameters (?r - robot ?c - color ?c2 - color)
:precondition (and (robot-has ?r ?c) (available-color ?c2))
:effect (and (not (robot-has ?r ?c)) (robot-has ?r ?c2)
(increase (total-cost) 5))
)
(:action paint-up
:parameters (?r - robot ?y - tile ?x - tile ?c - color)
:precondition (and (robot-has ?r ?c) (robot-at ?r ?x) (up ?y ?x) (clear ?y))
:effect (and (not (clear ?y)) (painted ?y ?c)
(increase (total-cost) 2))
)
(:action paint-down
:parameters (?r - robot ?y - tile ?x - tile ?c - color)
:precondition (and (robot-has ?r ?c) (robot-at ?r ?x) (down ?y ?x) (clear ?y))
:effect (and (not (clear ?y)) (painted ?y ?c)
(increase (total-cost) 2))
)
; Robot movements
(:action up
:parameters (?r - robot ?x - tile ?y - tile)
:precondition (and (robot-at ?r ?x) (up ?y ?x) (clear ?y))
:effect (and (robot-at ?r ?y) (not (robot-at ?r ?x))
(clear ?x) (not (clear ?y))
(increase (total-cost) 3))
)
(:action down
:parameters (?r - robot ?x - tile ?y - tile)
:precondition (and (robot-at ?r ?x) (down ?y ?x) (clear ?y))
:effect (and (robot-at ?r ?y) (not (robot-at ?r ?x))
(clear ?x) (not (clear ?y))
(increase (total-cost) 1))
)
(:action right
:parameters (?r - robot ?x - tile ?y - tile)
:precondition (and (robot-at ?r ?x) (right ?y ?x) (clear ?y))
:effect (and (robot-at ?r ?y) (not (robot-at ?r ?x))
(clear ?x) (not (clear ?y))
(increase (total-cost) 1))
)
(:action left
:parameters (?r - robot ?x - tile ?y - tile)
:precondition (and (robot-at ?r ?x) (left ?y ?x) (clear ?y))
:effect (and (robot-at ?r ?y) (not (robot-at ?r ?x))
(clear ?x) (not (clear ?y))
(increase (total-cost) 1))
)
)