;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*- File: planning/domains/air-cargo.lisp

;;;; The Air Cargo Transport Problem

(defun make-air-cargo-problem ()
  "Load and unload cargo onto and off planes and fly them between airports
  [Fig. 11.1].  One solution is ((Load C1 P1 SFO) (Fly P1 SFO JFK)
  (Unload C1 P1 JFK) (Load C2 P2 JFK) (Fly P2 JFK SFO) (Unload C2 P2 SFO))."
  (make-planning-problem
   :initial '((At C1 SFO) (At C2 JFK) (At P1 SFO) (At P2 JFK)
	      (Cargo C1) (Cargo C2) (Plane P1) (Plane P2)
	      (Airport JFK) (Airport SFO))
   :goal '((At C1 JFK) (At C2 SFO))
   :schemas
   (list (make-action-schema
	  :name '(Load $c $p $a)
	  :precond '((At $c $a) (At $p $a) (Cargo $c) (Plane $p) (Airport $a))
	  :effect '((not (At $c $a)) (In $c $p)))
	 (make-action-schema
	  :name '(Unload $c $p $a)
	  :precond '((In $c $p) (At $p $a) (Cargo $c) (Plane $p) (Airport $a))
	  :effect '((At $c $a) (not (In $c $p))))
	 (make-action-schema
	  :name '(Fly $p $from $to)
	  :precond '((At $p $from) (Plane $p) (Airport $from) (Airport $to))
	  :effect '((not (At $p $from)) (At $p $to))))))
