-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain-solution3.3.pddl
115 lines (85 loc) · 2.98 KB
/
domain-solution3.3.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
112
113
114
115
(define (domain travelling_agent_hire)
(:requirements :typing :adl :fluents :equality)
(:types
city ; represented by a node on the map
bus ;
car ;
agent ;
plane ;
)
(:constants
;; You should not need to add any additional constants
Agent - agent
)
(:predicates
(agentAt ?city - city) ; the agent is at city ?c
(carAt ?city - city) ; the car is at city ?c
(road ?c1 - city ?c2 - city) ; city ?c1 and city ?c2 are connected by a single road
(air ?c1 - city ?c2 - city) ; city ?c1 and city ?c2 are connected by a single air route (?c1 -> ?c2)
(visited ?city - city) ; the agent has visited city ?c
(carRental ?city - city) ; there is a car rental service at city ?c
(carRented ?city - city) ; a car is currently being rented from the car rental service at city ?c
)
(:functions (total-cost) (budget) (maxBus) (maxCar) (maxPlane) (maxHire))
(:action returnCar
:parameters (?c - city)
:precondition (and
(carRented ?c)
(agentAt ?c)
(carAt ?c)
(carRental ?c))
:effect (and
(not (carAt ?c))
(not (carRented ?c))))
(:action hire
:parameters (?c - city)
:precondition (and
(agentAt ?c)
(carRental ?c)
(not (carRented ?c))
(>= (maxHire) (total-cost))) ; checks if the agent has enough budget left to hire a car
:effect (and
(carAt ?c)
(increase (total-cost) 2)
(carRented ?c)))
(:action ride
:parameters (?from ?to - city)
:precondition (and
(agentAt ?from)
(road ?from ?to)
(>= (maxBus) (total-cost))) ; checks if the agent has enough budget left to buy a bus ticket
:effect (and
(not (agentAt ?from))
(agentAt ?to)
(increase (total-cost) 5)))
(:action drive
:parameters (?from ?to - city)
:precondition (and
(agentAt ?from)
(carAt ?from)
(road ?from ?to)
(>= (maxCar) (total-cost))) ; checks if the agent has enough budget left to drive their car
:effect (and
(not (agentAt ?from))
(not (carAt ?from))
(agentAt ?to)
(carAt ?to)
(increase (total-cost) 1)))
(:action fly
:parameters (?from ?to - city)
:precondition (and
(agentAt ?from)
(air ?from ?to)
(>= (maxPlane) (total-cost))) ; checks if the agent has enough budget left to buy a plane ticket
:effect (and
(not (agentAt ?from))
(agentAt ?to)
(increase (total-cost) 10)))
(:action visit
:parameters (?c - city)
:precondition (and
(agentAt ?c)
(not (visited ?c)))
:effect (and
(visited ?c)))
)