aasignmnet 7: rules 1. (40 points) In the armory folder of the Raven project, there is a java file for each type of weapon. Each of these files contains 9 fuzzy rules for determining the desirability of selecting that weapon. The textbook presented the Combs method for avoiding a combinatorial explosion of the rules, namely write the rules in the form of if p the r instead of if p and q then r. The rules in the weapon files are of the form if p and q the r (the lines beginning m_FuzzyModule.AddRule(...)). Make a copy of Raven, and then in each of the four weapon files, comment out the 9 fuzzy rules and add 6 Combs style rules. See if you can approximate or improve the selection behavior of the robots. Submit to the TA a copy of the rules you wrote for each weapon. If you notice any change of behavior when the robots are using your rules, comment about it in the email when you submit your rules. 2. (20 points) 1. Consider this robot-lightbulb problem. There is a room with a lightbulb in the ceiling somewhere near the room. In the room is a robot and a chest. Inside the chest is a cane. The robot wants to break the lightbulb. It can't do it while standing on the floor, and it can't do it while standing on the closed chest unless it is holding the cane so that it can swing the cane at the lightbulb. Write a list of rules that will solve this problem if they are tested in order until the first rule that can reach its conclusion; that rule's action is carried out, then the rules are retested from the beginning again until the problem is solved. In your rules, you can assume the availability of the following tests: sameLocation(X,Y) - X is at the same location as Y. (If X is next to Y or X is underneath Y or Y is underneath X, then sameLocation(X,Y) is true.) Possible values for X and Y are robot, chest, cane, bulb. on(robot,Y) - robot is on Y. The only values of Y that are relevant are Y = floor or Y = chest. holding(robot,cane) - robot is holding cane. open(chest) - chest is open. The chest is closed when it is not open. broken(bulb) - the bulb is broken, which is what the robot wants. These can be tested for being true or for being false. (In other words, you can use the not function when appropriate.) The actions that are available are: swing(robot,X,Y) - robot swings X at Y, breaking Y if the conditions are right. push(robot,X,Y) - robot pushes object X to the same location as Y. It is assumed that if the cane is in the chest, the location of the cane is the same as the location of the chest. This cannot be done while holding the cane. The chest can be pushed only when it is closed. climb(robot,chest) - robot climbs onto the chest. This can be done while holding the cane. makeOpen(robot,chest) - robot opens the chest. makeClosed(robot,chest) - robot closes the chest. It can do this while holding the cane. goTo(robot,X) - robot goes to the location of X so that they are at the same location. grab(robot,cane) - robot grabs cane if the conditions are right. Assume that initially the cane is in the chest and the robot is on the floor. It is not known initially which instances of sameLocation(X,Y) are true. The rules can have the general form if ... and ... , --- where the antecedent is any boolean combination of the tests listed above using and and not, and the consequent is one of the actions. Here is an example of a rule, though it is not one that you will want to use. if sameLocation(robot,chest) and not open(chest) and in(cane,chest), climb(robot,chest) Submit your rules to the TA.