;; =======================================================================================
;; Bucket Problem #2: If we need a lot of water and have a high-powered tap,
;; we bring a big bucket to the powerful tap.
;; Notice on the goal:
;; - the amount of water on DL should be equal to the requirement
;; - the time requirement is relatexed
;; A possible plan is
;; 1. pick up bucket 1 and bucket 2 at SL
;; 2. go to L2
;; 3. arrive at L2
;; 4. put down bucket 1 and bucket 2 at L2
;; 5. turn on tap 2 on bucket 2
;; 6. pick up bucket 2 at L2 & turn on tap 2 on bucket 1
;; 7. pick up bucket 1
;; 9. go to DL
;; 10. arrive at DL
;; 11. deliver bucket 1 (1 gallon out of 2 gallons)and bucket 2 (20 out of 20 gallons)
;; =========================================================================================
(define (problem p-2-bucket)
(:domain Buckets)
(:requirements :adl :time :fluents :continuous-effects)
(:objects SL - location L1 - location L2 - location DL - location
TAP1 - tap TAP2 - tap
BUCKET1 - bucket BUCKET2 - bucket
AGENT1 - agent
)
(:init (at AGENT1 SL)
(at BUCKET1 SL)
(at BUCKET2 SL)
(at TAP1 L1)
(at TAP2 L2)
(= (flow_rate TAP1) 0.2)
(= (flow_rate TAP2) 2)
(= (walking_speed AGENT1) 5)
(= (capacity BUCKET1) 2)
(= (capacity BUCKET2) 20)
(= (distance SL L1) 20)
(= (distance L1 SL) 20)
(= (distance SL L2) 40)
(= (distance L2 SL) 40)
(= (distance DL L1) 10)
(= (distance L1 DL) 10)
(= (distance DL L2) 10)
(= (distance L2 DL) 10)
(= (amount_of_water SL) 0)
(= (amount_of_water DL) 0)
(= (amount_of_water L1) 0)
(= (amount_of_water L2) 0)
(= (distance_to_walk AGENT1 SL) 0)
(= (distance_to_walk AGENT1 DL) 0)
(= (distance_to_walk AGENT1 L1) 0)
(= (distance_to_walk AGENT1 L2) 0)
(= (level BUCKET1) 0)
(= (level BUCKET2) 0)
(connected SL L1)
(connected L1 SL)
(connected SL L2)
(connected L2 SL)
(connected L1 DL)
(connected DL L1)
(connected L2 DL)
(connected DL L2)
)
(:goal (and (= (amount_of_water DL) 21)
(<= ?total-time 21)) ;; with 11 steps
)
)