;******* VERSION 1-1 ************************** January 30, 1989 ;;; ;;; This is an unstable version; new control rules are being tested and added, ;;; and the operators can also change. ;;; ;;; If you have any suggestion or question, please send mail to aperez@cs ;;; (setq *SCR-NODE-SELECT-RULES* nil) (setq *SCR-GOAL-SELECT-RULES* '((SELECT-FIRST-GOAL (lhs (and (current-node ) (list-of-candidate-goals ) (is-first-goal ))) (rhs (select goal ))))) (setq *SCR-OP-SELECT-RULES* ;; The following rules reject the operators that make the robot move pushing ;; an object when he should move alone '((MOVE-ROBOT-ONLY--SELECT-GO-THRU (lhs (and (current-node ) (current-goal (in-room )) (candidate-op GO-THRU-DOOR) (known (is-type robot)))) (rhs (select op GO-THRU-DOOR))) (MOVE-ROBOT-ONLY--SELECT-GOTO-OBJECT (lhs (and (current-node ) (current-goal (next-to )) (candidate-op GOTO-OBJECT) (known (is-type robot)))) (rhs (select op GOTO-OBJECT))) (MOVE-ROBOT-ONLY--SELECT-GOTO-DOOR (lhs (and (current-node ) (current-goal (next-to )) (candidate-op GOTO-DOOR) (known (is-type robot)))) (rhs (select op GOTO-DOOR))) )) (setq *SCR-BINDINGS-SELECT-RULES* ;; if the robot is in roomy and the goal is to be in room x, and roomx and ;; roomy are connected, it goes thru that door directly (avoids a longer path) '((SELECT-SHORTER-PATH (lhs (and (current-node ) (current-op GO-THRU-DOOR) (current-goal (in-room )) (known (in-room )) (known (or (connect ) (connect ))) (~ (known (statis locked))))) (rhs (select bindings ( )))) )) (setq *SCR-NODE-REJECT-RULES* nil) (setq *SCR-GOAL-REJECT-RULES* nil) (setq *SCR-OP-REJECT-RULES* ;;The following six reject-operator rules avoid that after failing to push an ;;object using only one robot, try to redo the same thing but using two robots ;;(This would be the same as adding a (greater weight *maxweight*) precond. ;;to the team operators) '((REJECT-TPOB-IF-ONE-CAN-ALONE (lhs (and (current-node ) (current-goal (next-to )) (known (and (weight ) (less-than 100))) (candidate-op PUSH-OBJECT) (candidate-op T-PUSH-OBJECT))) (rhs (reject op T-PUSH-OBJECT))) (REJECT-TPDO-IF-ONE-CAN-ALONE (lhs (and (current-node ) (current-goal (next-to )) (known (and (weight ) (less-than 100))) (candidate-op PUSH-TO-DOOR) (candidate-op T-PUSH-TO-DOOR))) (rhs (reject op T-PUSH-TO-DOOR))) (REJECT-TPLOC-IF-ONE-CAN-ALONE (lhs (and (current-node ) (current-goal (at )) (known (and (weight ) (less-than 100))) (candidate-op PUSH-TO-LOC) (candidate-op T-PUSH-TO-LOC))) (rhs (reject op T-PUSH-TO-LOC))) (REJECT-TPTD-IF-ONE-CAN-ALONE (lhs (and (current-node ) (current-goal (in-room )) (known (and (weight ) (less-than 100))) (candidate-op PUSH-THRU-DOOR) (candidate-op T-PUSH-THRU-DOOR))) (rhs (reject op T-PUSH-THRU-DOOR))) (REJECT-TPINTO-IF-ONE-CAN-ALONE (lhs (and (current-node ) (current-goal (in )) (known (and (weight ) (less-than 100))) (candidate-op PUT-BLOCK-INTO-BOX) (candidate-op T-PUT-BLOCK-INTO-BOX))) (rhs (reject op T-PUT-BLOCK-INTO-BOX))) (REJECT-TTOUT-IF-ONE-CAN-ALONE (lhs (and (current-node ) (current-goal (~(in ))) (known (and (weight ) (less-than 100))) (candidate-op TAKE-BLOCK-OUT-OF-BOX) (candidate-op T-TAKE-BLOCK-OUT-OF-BOX))) (rhs (reject op T-TAKE-BLOCK-OUT-OF-BOX))) )) (setq *SCR-BINDINGS-REJECT-RULES* ;;This rule avoids that the robot attempts to go to a room that he has already ;;visited, i.e. is in the stack goal, when trying to find a path from one room ;;to other one. '((REJECT-GOING-BACK-TO-SAME-ROOM (lhs (and (current-node ) (current-goal (in-room )) (current-op GO-THRU-DOOR) (candidate-bindings ( )) (on-goal-stack (in-room )))) (rhs (reject bindings ( )))) ;; These rules avoid to generate bindings for the TEAM operators such that the ;; only difference among them is the order in the robot vars. The ;; string-greaterp is a trick to distinguish between the two robots (there is ;; no other way, unless they had different capabilities) and should be ;; reconsidered if they had, since it could reject good alternatives. ;; The rules are only useful when the team op does not lead to a solution ;; (otherwise, the first couple of bindings is valid and no other bindings ;; are tried (TPOB-SELECT-ONLY-ONE-COUPLE (lhs (and (current-node ) (current-op T-PUSH-OBJECT) (candidate-bindings ( )) (candidate-bindings ( )) (known (greater-var )))) (rhs (reject bindings ( )))) (TPDO-SELECT-ONLY-ONE-COUPLE (lhs (and (current-node ) (current-op T-PUSH-TO-DOOR) (candidate-bindings ( )) (candidate-bindings ( )) (known (greater-var )))) (rhs (reject bindings ( )))) (TPLOC-SELECT-ONLY-ONE-COUPLE (lhs (and (current-node ) (current-op T-PUSH-TO-LOC) (candidate-bindings ( )) (candidate-bindings ( )) (known (greater-var )))) (rhs (reject bindings ( )))) (TPTD-SELECT-ONLY-ONE-COUPLE (lhs (and (current-node ) (current-op T-PUSH-THRU-DOOR) (candidate-bindings ( )) (candidate-bindings ( )) (known (greater-var )))) (rhs (reject bindings ( )))) (TPINTO/OUT-SELECT-ONLY-ONE-COUPLE (lhs (and (current-node ) (or (current-op T-PUT-BLOCK-INTO-BOX) (current-op T-PUT-BLOCK-INTO-BOX)) (candidate-bindings ( )) (candidate-bindings ( )) (known (greater-var )))) (rhs (reject bindings ( )))) )) (setq *SCR-NODE-PREFERENCE-RULES* nil) (setq *SCR-GOAL-PREFERENCE-RULES* nil) (setq *SCR-OP-PREFERENCE-RULES* nil ) (setq *SCR-BINDINGS-PREFERENCE-RULES* ;;If a door has to be opened because has to go thru it, is ;;the preferred candidate to open the door, since he will have to go near ;;the door anyway '((PREFER-ROBOT-THAT-HAS-TO-GO-THRU-FOR-OPEN-DOOR (priority 0) (lhs (and (current-node ) (current-op OPEN-DOOR) (on-goal-stack (in-room )) (candidate-bindings ( )) (candidate-bindings ( )) (known (connects )))) (rhs (prefer bindings ( ) ( )))) ))