next up previous

CSE 5361 Spring 1999

Homework 2

Due: February 23, 1999, 7:00pm (February 24, 1999, 7:00pm for -10%)

For this homework you will augment your State class from HW1 and implement a REFLEX-AGENT-WITH-STATE, as in Figure 2.10 of Russell and Norvig, to navigate the wumpus world. The specific requirements are enumerated below.

Implement a STATE class to hold information about the agent (e.g., location, arrows, gold) and information gained about the current wumpus world (e.g., locations of stenches, breezes, pits, wumpi, gold, walls). Your agent will be tested by running wumpus -t 5 -s N (where N may vary between 4 and 10), so you should retain state information from one trial to the next.

Implement a procedure UPDATESTATE that changes the STATE based on the recently received percept. You will also want to look at the percept and action sequence history maintained by the simulator to help with the state update. The second call to UPDATESTATE in REFLEX-AGENT-WITH-STATE for the selected action is optional.

Implement a procedure CHOOSEACTION that returns the action based on the state information and condition-action rules. This procedure replaces the two lines calling RULE-MATCH and RULE-ACTION in the REFLEX-AGENT-WITH-STATE. You can use the KnowledgeBase class to implement the condition-action rule base. Or, you can implement the condition-action rules in code, but try to be as modular as possible. For example, if the last percept contained glitter, then GRAB would be a good action. If you know a square is ``unsafe'', you might want to move away (if cautious) or move there (if adventurous). Most of your effort on this assignment should go into making CHOOSEACTION as intelligent as possible. Corresponding effort in UPDATESTATE will facilitate better action choices.

Email to me ( all of your .hh and .cc files. If your code requires any special compilation instructions, let me know or send me your Makefile. Be sure your code is well-documented and compiles using g++ on gamma2.

next up previous