-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplanetary.pddl
111 lines (100 loc) · 3.04 KB
/
planetary.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
(define (domain planetary)
(:requirements
:strips
:fluents
:durative-actions
:timed-initial-literals
:typing
:conditional-effects
:negative-preconditions
:equality
:constraints
:preferences
)
(:types
robot
location
speedType
taskType
)
(:predicates
(at ?robot - robot ?location - location)
(connected ?from - location ?to - location)
)
;(:constraints (and
; (forall (?robot - robot) (always
; (> (battery ?robot) 0)
; ))
;))
(:functions
(distance ?from - location ?to - location)
(speed ?robot - robot ?speedType - speedType)
(battery ?robot - robot)
(moveBurn ?robot - robot ?speedType - speedType)
(taskBurn ?robot - robot ?taskType - taskType)
(maxBattery ?robot - robot)
(rechargeRate ?robot - robot)
(tasks ?location - location ?taskType - taskType)
(taskDuration ?robot - robot ?taskType - taskType)
(totalTime)
(totalBattery)
(totalDistance)
(recharges)
)
(:durative-action move
:parameters (
?robot - robot
?from - location
?to - location
?speedType - speedType
)
:duration (= ?duration (/(distance ?from ?to) (speed ?robot ?speedType)))
:condition (and
(at start (at ?robot ?from))
(over all (connected ?from ?to))
(at end (> (battery ?robot) 0))
)
:effect (and
(at start (not (at ?robot ?from)))
(at end (at ?robot ?to))
(at end (decrease (battery ?robot) (* (distance ?from ?to) (moveBurn ?robot ?speedType))))
(at end (increase (totalBattery) (* (distance ?from ?to) (moveBurn ?robot ?speedType))))
(at end (increase (totalTime) (/ (distance ?from ?to) (speed ?robot ?speedType))))
(at end (increase (totalDistance) (distance ?from ?to)))
)
)
(:durative-action recharge
:parameters (
?robot - robot
?location - location
)
:duration (= ?duration (* (- (maxBattery ?robot) (battery ?robot)) (rechargeRate ?robot)))
:condition (and
(over all (< (battery ?robot) (maxBattery ?robot)))
(over all (at ?robot ?location))
)
:effect (and
(at end (assign (battery ?robot) (maxBattery ?robot)))
(at end (increase (totalTime) (* (- (maxBattery ?robot) (battery ?robot)) (rechargeRate ?robot))))
(at end (increase (recharges) 1))
)
)
(:durative-action performTask
:parameters (
?robot - robot
?location - location
?taskType - taskType
)
:duration (= ?duration (taskDuration ?robot ?taskType))
:condition (and
(over all (at ?robot ?location))
(at start (> (battery ?robot) (*(taskBurn ?robot ?taskType) (taskDuration ?robot ?taskType))))
)
:effect (and
(at end (increase (tasks ?location ?taskType) 1))
(at end (decrease (battery ?robot) (*(taskBurn ?robot ?taskType) (taskDuration ?robot ?taskType))))
(at end (increase (totalBattery) (*(taskBurn ?robot ?taskType) (taskDuration ?robot ?taskType))))
(at end (increase (totalTime) (taskDuration ?robot ?taskType)))
)
)
)