(in-package "RDX") ;; This is a travel planning example taken from ``Constrained Decision ;; Revision,'' Proc. 10th Nat. Conf. on AI,San Jose pp. 393-400, AAAI ;; Press, July, 1992. See page 393. (setq *remote* nil) ;; this means that ACK messages are suppressed. (setq *suspend-acks* t) (create-goal "Travel from Austin to Arlington" `Plan-Trip) (make-root-goal "Design-Manager" `Plan-Trip) (create-goal "Fly from Austin to DFW" `Choose-Flight) (create-goal "Find transport from DFW" `Ground-Travel) (tell-fact "Design-Manager" "Canceled AA86" 'Canceled-AA86) (tell-fact "Design-Manager" "Canceled DEL201" 'Canceled-DEL201) (erase-fact "Design-Manager" 'Canceled-AA86) (erase-fact "Design-Manager" 'Canceled-DEL201) (create-string-decision ;; Choose-Flying "Travel from Austin to Arlington" ;; Goal "Design-Manager" ;; Agent (list ;; Assignments (list "Assign-Agent" "Design-Manager" "Fly from Austin to DFW" 'AA-Flight) (list "Assign-Agent" "Design-Manager" "Find transport from DFW" 'AA-Ground)) (list "Fly from Austin to DFW" "Find transport from DFW") ;; Subgoals) nil ;; Contingencies (list "Distance > 100 miles") ;; Reasons nil ;; Inputs `Choose-Flying) ;; optional Decision Name (tell-fact "SABRE" "Cost AA86 $65" 'Cost-AA86) (create-string-decision ;; Flight-AA86 "Fly from Austin to DFW" ;; Goal "Design-Manager" ;; Agent (list (list "Flight" "Trip" "AA86" 'AA86)) ;; Assignments nil ;; Subgoals) (list "Canceled AA86") ;; Contingencies (list 'Cost-AA86) ;; Reasons nil ;; Inputs `Flight-AA86) ;; optional Decision Name (create-string-decision ;; Take-Taxi "Find transport from DFW" ;; Goal "Design-Manager" ;; Agent (list (list "Ground-T" "Trip" "Taxi") ;; Assignments (list "Cost" "taxi" "$60" 'Cost-Taxi)) nil ;; Subgoals) nil ;; Contingencies (list "Fast and easy") ;; Reasons nil ;; Inputs `Take-Taxi) ;; optional Decision Name (create-constraint "Design-Manager" `(AA86 Cost-AA86 Cost-Taxi) "Budget $100") (create-string-decision ;; Take-Shuttle "Find transport from DFW" ;; Goal "Design-Manager" ;; Agent (list (list "Ground-T" "Trip" "Shuttle") ;; Assignments (list "Cost" "taxi" "$20" 'Cost-Shuttle)) nil ;; Subgoals) nil ;; Contingencies (list "Inexpensive") ;; Reasons nil ;; Inputs `Take-Shuttle) ;; optional Decision Name (tell-fact "SABRE" "Cost DEL201 $85" 'Cost-DEL201) (create-string-decision ;; Flight-DEL201 "Fly from Austin to DFW" ;; Goal "Design-Manager" ;; Agent (list (list "Flight" "Trip" "DEL201" 'DEL201)) ;; Assignments ;; (list "Cost" "DEL201" "$85" 'Cost-DEL201)) nil ;; Subgoals) (list "Canceled DEL201") ;; Contingencies nil ;; Reasons nil ;; Inputs `Flight-DEL201) ;; optional Decision Name (create-constraint "Design-Manager" `(DEL201 Cost-DEL201 Cost-Taxi) "Budget $100") (create-constraint "Design-Manager" `(DEL201 Cost-DEL201 Cost-Shuttle) "Budget $100") (format t "~%> (make Choose-Train) *Take a train*~%") (create-string-decision ;; Choose-Train "Travel from Austin to Arlington" ;; Goal "Design-Manager" ;; Agent (list "Take the Flyer" ;; Assignments (list "Time" "train" "3 hours" 'Time-Train)) nil ;; Subgoals nil ;; Contingencies (list "Comfortable") ;; Reasons nil ;; Inputs `Choose-Train) ;; optional Decision Name (create-constraint "Design-Manager" `(Time-Train) "Train Time Too long") (format t "~%> (make Choose-Bus) *Take a bus the whole way*~%") (create-string-decision ;; Choose-Bus "Travel from Austin to Arlington" ;; Goal "Design-Manager" ;; Agent (list "Take a bus all the way" ;; Assignments (list "Cost" "bus" "$80" 'Cost-Bus)) nil ;; Subgoals nil ;; Contingencies (list "Comfortable") ;; Reasons nil ;; Inputs `Choose-Bus) ;; optional Decision Name