next up previous

CSE 5361 Spring 1999

Homework 3

Due: March 9, 1999, 7:00pm (March 10, 1999, 7:00pm for -10%)

The wumpus-world reflex agent from HW2 is unable to search into the future to see the effects of a sequence of actions. For this homework, you will implement a variant of the SIMPLEPROBLEMSOLVINGAGENT [Russell and Norvig, Figure 3.1] based on a depth-limited depth-first search. A collection of C++ search classes written by Peter Bouthoorn is available in the directory /public/cse/5361-501/aisrch2. The main goal of this homework is the integration of the depth-limited, depth-first tree search class into your wumpus-world agent. Specifically,

Familiarize yourself with the search-class code. I would begin by reading the README file and the Description file in the programs/8puzzle directory. Note: since the wumpus simulator uses some of the aisrch2 code to implement the knowledge base, you cannot use the aisrch2 code in your player due to symbol conflicts. Instead, you should use the code in aisrch3, which contains a stripped-down version of the aisrch2 code with appropriate symbol changes. See aisrch3/README for details. Also, see the hw3 directory for an example of how all this will fit together.

As in the examples in the programs/8puzzle directory, define a PNode for the wumpus world derived from the DepthNode class. This should be similar to the STATE class you built for HW2, although you may want to simplify the PNode state used by the search to conserve memory. You should still keep a current STATE from which you can create the initial PNode state for each search call. Your UPDATESTATE procedure should modify this current STATE during play, as before.

The FORMULATEGOAL procedure of SIMPLEPROBLEMSOLVINGAGENT will return a goal PNode to search for. However, you will not always want to search for one specific state, but more likely for a state satisfying certain conditions (e.g., any unvisited location). Therefore, you will need to allow for ``don't care'' conditions in the goal PNode and in the search engine's goal test function is_goal. Other possible goals, from which FORMULATEGOAL should choose based on the current STATE, could be to kill the wumpus, get a gold piece, or leave the cave.

FORMULATEPROBLEM is a trivial composition of the initial state, goal state and operators, which are already known. The only other function FORMULATEPROBLEM serves is the selection of the depth limit. You are free to choose the depth limit in any fashion, but obviously accumulated knowledge (e.g., boundaries) of the world impacts the choice.

SEARCH creates an instance of the depth-limited search class initialized with the above information and calls its generate function to search for the goal. The search may or may not find a sequence of actions leading to the goal. If a solution sequence is found, you would return the first action of the sequence and possibly retain the remaining sequence for future action selection. If no solution is found, your agent should fall back on some rudimentary action selection. To improve search performance, the individual operators called from the do_operator function of PNode should not allow clearly wrong actions (e.g., climb when not in (0,0), shoot with no arrows, grab with no glitter, etc.).

Your player should output the initial state, goal state and the result of the call to search each time the player selects an action. 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