-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathdomain.pddl
69 lines (61 loc) · 2.77 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
; IPC5 Domain: TPP ComplexPreference
; Authors: Alfonso Gerevini and Alessandro Saetti
(define (domain TPP-MetricTimePreferences)
(:requirements :typing :fluents :adl :durative-actions :constraints :preferences)
(:types depot market - place
truck goods - locatable)
(:predicates (connected ?p1 ?p2 - place)
(at ?t - truck ?p - place))
(:functions (on-sale ?g - goods ?m - market)
(ready-to-load ?g -goods ?m - place)
(drive-cost ?p1 ?p2 - place)
(drive-time ?p1 ?p2 - place)
(loaded ?g - goods ?t - truck)
(stored ?g - goods)
(price ?g - goods ?m - market)
(bought ?g - goods)
(request ?g - goods)
(total-cost)
(rebate-rate ?m - market))
(:durative-action drive
:parameters (?t - truck ?from ?to - place)
:duration (= ?duration (drive-time ?from ?to))
:condition (and (preference p-drive (at start (forall (?g - goods)
(< (ready-to-load ?g ?from) 1))))
(at start (at ?t ?from)) (over all (connected ?from ?to)))
:effect (and (at start (not (at ?t ?from))) (at end (at ?t ?to))
(at end (increase (total-cost) (drive-cost ?from ?to)))))
(:durative-action load
:parameters (?g - goods ?t - truck ?m - market)
:duration (= ?duration (* 1.0 (ready-to-load ?g ?m)))
:condition (and (at start (> (ready-to-load ?g ?m) 0)) (over all (at ?t ?m)))
:effect (and (at start (increase (loaded ?g ?t) (ready-to-load ?g ?m)))
(at start (assign (ready-to-load ?g ?m) 0))))
(:durative-action unload
:parameters (?t - truck ?g - goods ?d - depot)
:duration (= ?duration (* 1.0 (loaded ?g ?t)))
:condition (and (at start (> (loaded ?g ?t) 0)) (over all (at ?t ?d)))
:effect (and (at start (increase (stored ?g) (loaded ?g ?t)))
(at start (assign (loaded ?g ?t) 0))))
(:durative-action buy-allneeded
:parameters (?t - truck ?g - goods ?m - market)
:duration (= ?duration 1.0)
:condition (and (at start (> (on-sale ?g ?m) (- (request ?g) (bought ?g))))
(at start (> (on-sale ?g ?m) 0)) (over all (at ?t ?m)))
:effect (and (at start (decrease (on-sale ?g ?m)
(- (request ?g) (bought ?g))))
(at start (increase (ready-to-load ?g ?m)
(- (request ?g) (bought ?g))))
(at start (increase (total-cost) (* (- (request ?g) (bought ?g))
(price ?g ?m))))
(at start (assign (bought ?g) (request ?g)))))
(:durative-action buy-all
:parameters (?t - truck ?g - goods ?m - market)
:duration (= ?duration 1.0)
:condition (and (at start (> (on-sale ?g ?m) 0)) (over all (at ?t ?m)))
:effect (and (at start (assign (on-sale ?g ?m) 0))
(at start (increase (ready-to-load ?g ?m) (on-sale ?g ?m)))
(at start (increase (total-cost) (* (rebate-rate ?m)
(* (on-sale ?g ?m) (price ?g ?m)))))
(at start (increase (bought ?g) (on-sale ?g ?m)))))
)