-
Notifications
You must be signed in to change notification settings - Fork 1
/
domain_b1.pddl
69 lines (59 loc) · 2.2 KB
/
domain_b1.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
; Guy - ECE final project vB1
; minimizes total length of all the robots based on the length of
; each action. this means that we need to encode the path length
; of each combination (loc(i)->loc(j), loc(j)->loc(i) for all connected i,j) in the task file.
; it does not take into any account the reactive nature which might elongate the path.
; encode unconnected two points with a ridiculously large cost.
; added feature: allow blocking.
(define (domain auto_warehouse)
;; Defining options for the planning system
(:requirements :adl :typing :action-costs)
;; Defining types
(:types
forklift_a forklift_b - agent
nodes - location
pallet_a pallet_b - pallet
pallet agent - physobj
physobj operation location - object
)
; just dummy for stopping
(:constants
stop - operation
)
(:functions
(distance ?from ?to)
(total-cost)
)
(:predicates
;location of a robot or package. Either initial, pickup or dropoff
(at ?obj - physobj ?loc - location)
;is a certain pallet on a certain robot?
(on ?pkg - pallet ?robot - agent)
;can we use this forklift or this package
(avail ?obj - physobj )
;the essentially creates the graph of the roadmap
(connected ?x - location ?y - location)
)
;just moves the robot between places
(:action move
:parameters (?robot - agent ?from - location ?to - location)
:precondition (and (at ?robot ?from) (connected ?from ?to) )
:effect (and (at ?robot ?to) (not (at ?robot ?from)) (increase (total-cost) (distance ?from ?to)))
)
;pickup a pallet if robot is at the location of the pallet and it's capacity
;is allowing
(:action load
:parameters (?robot - agent ?unit - pallet ?loc - location)
:precondition (and (avail ?robot) (avail ?unit)
(at ?robot ?loc) (at ?unit ?loc ) )
:effect (and (not (avail ?unit)) (not (avail ?robot))
(on ?unit ?robot) (not (at ?unit ?loc ))
(increase (total-cost) 1))
)
(:action unload
:parameters (?robot - agent ?unit - pallet ?loc - location)
:precondition (and (at ?robot ?loc) (on ?unit ?robot) )
:effect (and (not (on ?unit ?robot)) (at ?unit ?loc) (avail ?robot)
(increase (total-cost) 1))
)
)