-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain.pddl
72 lines (69 loc) · 2.99 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
(define (domain multi_agent_lines)
(:requirements :fluents :adl :typing)
(:types agent tank well - object)
(:predicates (has-water ?a - agent) (has-filled ?a - agent))
(:functions (xloc ?o - object) (yloc ?o - object) - integer
(walls) - bit-matrix)
(:action collect
:parameters (?a - agent ?w - well)
:precondition (and (not (has-water ?a))
(or (and (= (xloc ?a) (xloc ?w)) (= (- (yloc ?a) 1) (yloc ?w)))
(and (= (xloc ?a) (xloc ?w)) (= (+ (yloc ?a) 1) (yloc ?w)))
(and (= (- (xloc ?a) 1) (xloc ?w)) (= (yloc ?a) (yloc ?w)))
(and (= (+ (xloc ?a) 1) (xloc ?w)) (= (yloc ?a) (yloc ?w)))))
:effect (has-water ?a)
)
(:action fill
:parameters (?a - agent ?t - tank)
:precondition (and (has-water ?a)
(or (and (= (xloc ?a) (xloc ?t)) (= (- (yloc ?a) 1) (yloc ?t)))
(and (= (xloc ?a) (xloc ?t)) (= (+ (yloc ?a) 1) (yloc ?t)))
(and (= (- (xloc ?a) 1) (xloc ?t)) (= (yloc ?a) (yloc ?t)))
(and (= (+ (xloc ?a) 1) (xloc ?t)) (= (yloc ?a) (yloc ?t)))))
:effect (and (not (has-water ?a)) (has-filled ?a))
)
(:action up
:parameters (?a - agent)
:precondition
(and (> (yloc ?a) 1)
(= (get-index walls (- (yloc ?a) 1) (xloc ?a)) false)
(not (exists (?t - tank)
(and (= (xloc ?a) (xloc ?t)) (= (- (yloc ?a) 1) (yloc ?t)))))
(not (exists (?w - well)
(and (= (xloc ?a) (xloc ?w)) (= (- (yloc ?a) 1) (yloc ?w))))))
:effect (decrease (yloc ?a) 1)
)
(:action down
:parameters (?a - agent)
:precondition
(and (< (yloc ?a) (height walls))
(= (get-index walls (+ (yloc ?a) 1) (xloc ?a)) false)
(not (exists (?t - tank)
(and (= (xloc ?a) (xloc ?t)) (= (+ (yloc ?a) 1) (yloc ?t)))))
(not (exists (?w - well)
(and (= (xloc ?a) (xloc ?w)) (= (+ (yloc ?a) 1) (yloc ?w))))))
:effect (increase (yloc ?a) 1)
)
(:action left
:parameters (?a - agent)
:precondition
(and (> (xloc ?a) 1)
(= (get-index walls (yloc ?a) (- (xloc ?a) 1)) false)
(not (exists (?t - tank)
(and (= (- (xloc ?a) 1) (xloc ?t)) (= (yloc ?a) (yloc ?t)))))
(not (exists (?w - well)
(and (= (- (xloc ?a) 1) (xloc ?w)) (= (yloc ?a) (yloc ?w))))))
:effect (decrease (xloc ?a) 1)
)
(:action right
:parameters (?a - agent)
:precondition
(and (< (xloc ?a) (width walls))
(= (get-index walls (yloc ?a) (+ (xloc ?a) 1)) false)
(not (exists (?t - tank)
(and (= (+ (xloc ?a) 1) (xloc ?t)) (= (yloc ?a) (yloc ?t)))))
(not (exists (?w - well)
(and (= (+ (xloc ?a) 1) (xloc ?w)) (= (yloc ?a) (yloc ?w))))))
:effect (increase (xloc ?a) 1)
)
)