;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; EATING WITHIN TRIVIAL GRIDWORLD ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; First (load "gridworld-definitions.lisp") ;; and (load "gridworld-planning.lisp") ;; and then (load "eg-eating-world2.lisp") ;; (which is this file) (def-roadmap '(home) nil); one point, no roads (def-object 'robot '(is_animate can_talk)) (place-object 'ME 'robot 'home 0 nil ; no associated-things '((hungry me)) nil) ; no propositional attitudes (place-object 'apple1 'apple 'home 0 nil '((edible apple1)) nil) (place-object 'banana1 'banana 'home 0 nil '((edible banana1)) nil ) (setq eat (make-op :name 'eat :pars '(?x ?y ?z); ?x eats ?y at ?z :preconds '((is_at ?x ?z) (is_at ?y ?z) (edible ?y) (hungry ?x)) :effects '((not (is_at ?y ?z)) (not (edible ?y)) (not (hungry ?x)) ) :value 2 )); NB: happiness independent of eater (setq sleep (make-op :name 'sleep :pars '() :preconds '((not (hungry me))) :effects '((hungry me)) :value 2 )) (setq *operators* '(eat sleep)) (setq *search-beam* (list (cons 3 *operators*) (cons 3 *operators*) (cons 3 *operators*) )) ;; Possible continuation: ;; (initialize-state) ;; (go!) ;; The state-value function here is presumed to be the generic one ;; in `gridworld-planning.lisp'. ;;========================================================================== ;; SOME RESULTS WHEN THE ABOVE COMMANDS ARE EXECUTED ARE SHOWN IN ;; eg-eating-world2-output.lisp