;; logistics domain - modified to include metric constraints. ;; ;; Fixes a few missing parameter predicates and ;; has unload truck and plane as separate operators ;; (as in original formulation). ;; 12 June 1998, Bart Selman & Henry Kautz ;; ;; 13 Oct 1998, Steve Wolfman - modified to metricize (include ;; metric effects/preconditions/parms) ;; ;; Note: changed so that planes can load and unload only at airports. ;; only possible problem I can think of with this is if AIRPLANEs ;; can be OBJs (and moved around by trucks... cool thought!) ;; (define (domain logistics-metric) ;; Note: I have _not_ added in the proper slew of requirements, ;; nor are there any preexisting ones that really match up. (:requirements :strips) ;; Type heirarchy (TYPE1 TYPE2 ... - SUPERTYPE ...) (:types LOCATION CITY MOVABLE - OBJECT OBJ VEHICLE - MOVABLE AIRPORT - LOCATION TRUCK AIRPLANE - VEHICLE) (:predicates (at ?obj - MOVABLE ?loc - LOCATION) (in ?obj - OBJ ?obj - VEHICLE) (in-city ?loc - LOCATION ?city - CITY) (depot ?loc - LOCATION) ) ;; Load ?truck with ?obj at ?loc (:action LOAD-TRUCK :parameters (?obj - OBJ ?truck - TRUCK ?loc - LOCATION) :precondition (and (at ?truck ?loc) (at ?obj ?loc)) :effect (and (not (at ?obj ?loc)) (in ?obj ?truck))) ;; Refuel ?veh (plane or truck) at ?loc. (:action REFUEL :parameters (?veh - VEHICLE ?loc - LOCATION) :precondition (and (at ?veh ?loc) (depot ?loc)) :effect ;; Capacities and (initial) fuel levels are defined ;; in the problems. (and (set ?fuel[?veh] ?capacity[?veh]))) ;; Load ?airplane with ?obj at ?loc (only airports!). (:action LOAD-AIRPLANE :parameters (?obj - OBJ ?airplane - AIRPLANE ?loc - AIRPORT) :precondition (and (at ?obj ?loc) (at ?airplane ?loc)) :effect (and (not (at ?obj ?loc)) (in ?obj ?airplane))) ;; Unload ?obj from ?truck at ?loc. (:action UNLOAD-TRUCK :parameters (?obj - OBJ ?truck - TRUCK ?loc - LOCATION) :precondition (and (at ?truck ?loc) (in ?obj ?truck)) :effect (and (not (in ?obj ?truck)) (at ?obj ?loc))) ;; Unload ?obj from ?airplane at ?loc (only airports!). (:action UNLOAD-AIRPLANE :parameters (?obj - OBJ ?airplane - AIRPLANE ?loc - AIRPORT) :precondition (and (in ?obj ?airplane) (at ?airplane ?loc)) :effect (and (not (in ?obj ?airplane)) (at ?obj ?loc))) ;; Drive ?truck from ?loc-from to ?loc-to inside ?city. ;; This is a hairy operator in expansions particularly when ;; one considers that trucks _never_ move between cities. (:action DRIVE-TRUCK :parameters (?truck - TRUCK ?loc-from - LOCATION ?loc-to - LOCATION ?city - CITY) :precondition (and (at ?truck ?loc-from) (in-city ?loc-from ?city) (in-city ?loc-to ?city) ;; Make sure the truck has enough fuel. This ;; could be replaced by a test on ?fuel', the fuel ;; level at the next step (just make sure its >= 0). (test ?fuel[?truck] >= ?truck_trip)) :effect (and (not (at ?truck ?loc-from)) (at ?truck ?loc-to) (set ?fuel[?truck] ?fuel[?truck] - ?truck_trip))) ;; Fly ?airplane from ?loc-from to ?loc-to. (:action FLY-AIRPLANE :parameters (?airplane - AIRPLANE ?loc-from - AIRPORT ?loc-to - AIRPORT) :precondition (and (at ?airplane ?loc-from) ;; Plane trips are dependent on distance (truck ;; trips all use the same amt of fuel). (test ?fuel[?airplane] >= ?airplane_trip + ?dist[?loc-from,?loc-to] / ?plane_mpg)) :effect (and (not (at ?airplane ?loc-from)) (at ?airplane ?loc-to) (set ?fuel[?airplane] ?fuel[?airplane] - ?airplane_trip - ?dist[?loc-from,?loc-to] / ?plane_mpg))) )