⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oldblocks

📁 SHOP2 一个人工智能里面关于任务分解和任务规划的系统。JSHOP2是其java版本。
💻
字号:
;;; This file contains a SHOP domain representation of the block-stacking;;; algorithm from the following paper:;;;    N. Gupta and D. Nau, On the complexity of blocks-world planning,;;;    Artificial Intelligence 56(2-3):223-254, August 1992.;;; ------------------------------------------------------------------------;;; Declare all the data;;; ------------------------------------------------------------------------(defdomain oldblocks  (    ;; basic block-stacking operators    (:operator (!pickup ?a)               ()               ((clear ?a) (on-table ?a))               ((holding ?a)))    (:operator (!putdown ?b)               ()               ((holding ?b))               ((on-table ?b) (clear ?b)))    (:operator (!stack ?c ?d)               ()               ((holding ?c) (clear ?d))               ((on ?c ?d) (clear ?c)))    (:operator (!unstack ?e ?f)               ()               ((clear ?e) (on ?e ?f))               ((holding ?e) (clear ?f)))    ;; book-keeping methods & ops, to keep track of what needs to be done    (:operator (!!assert ?g)               ()               ()               ?g               ;; Since !!ASSERT isn't a real blocks-world operator, make its cost 0               0)    (:method (achieve-goals ?goals)             ()             ((assert-goals ?goals nil) (move-block)))    (:method (assert-goals (?goal . ?goals) ?out)             ()             ((assert-goals ?goals ((goal ?goal) . ?out))))    (:method (assert-goals nil ?out)             ()             ((!!assert ?out)))    ;; The methods and operators for doing the actual planning    (:method (move-block)             ;; method for moving x from y to z             ((clear ?x) (not (nomove ?x)) (on ?x ?y)             (goal (on ?x ?z)) (not (same ?x ?z)) (clear ?z) (not (need-to-move ?z)))             ((!unstack ?x ?y) (!stack ?x ?z) (!!assert ((nomove ?x))) (move-block))             ;; method for moving x from y to table             ((clear ?x) (not (nomove ?x))             (on ?x ?y) (goal (on-table ?x)))             ((!unstack ?x ?y) (!putdown ?x) (!!assert ((nomove ?x))) (move-block))             ;; method for moving x from table to y             ((clear ?x) (not (nomove ?x))             (on-table ?x) (goal (on ?x ?y)) (clear ?y) (not (need-to-move ?y)))             ((!pickup ?x) (!stack ?x ?y) (!!assert ((nomove ?x))) (move-block))             ;; method for moving x out of the way             ((clear ?x) (not (nomove ?x))             (on ?x ?y) (need-to-move ?x))             ((!unstack ?x ?y) (!putdown ?x) (move-block))             ;; if nothing else matches, then we're done             nil             nil)    ;; state axioms     (:- (same ?x ?x) nil)     (:- (need-to-move ?x)         ;; need to move x if x needs to go from one block to another         ((on ?x ?y) (goal (on ?x ?z)) (not (same ?y ?z)))         ;; need to move x if x needs to go from table to block         ((on-table ?x) (goal (on ?x ?z)))         ;; need to move x if x needs to go from block to table         ((on ?x ?y) (goal (on-table ?x)))         ;; need to move x if x is on y and y needs to be clear         ((on ?x ?y) (goal (clear ?y)))         ;; need to move x if x is on z and something else needs to be on z         ((on ?x ?z) (goal (on ?y ?z)) (not (same ?x ?y)))         ;; need to move x if x is on something else that needs to be moved         ((on ?x ?w) (need-to-move ?w)))     ))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -