CS370 Program 2 (Due October 9, 1998)

In this assignment, you will create a new vacuum agent which has an improved sensor system. Your new agent now has access to the full state of the world. During the perception phase, several global variables are updated which indicate the state of the world (in a two-d array of characters, and the agents coordinate location). Your task will be to develop the most efficient agent possible given the information it has access to.

1. Assignment

The environment is implemented as an m by n rectangular room where each square now has a 5% chance of containing dirt. Each time an instance of this environment is created, m and n are chosen uniformly from the range 8 to 15 inclusive. In addition, furniture will be randomly strewn around the room.

First, implement an agent which uses A* search to make its decisions. In the directory ~echown/courses/370/search are a series of search routines which include A* (called best-first in the code). The demos directory includes a number of examples which you ought to find helpful. In particular demo4 which does A* search on the 8-puzzle should be especially useful for this project. Start out by implementing the vacuum world as a pure search problem.

It will probably be helpful to debug your search code on a relatively small (eg. 3X3) world. Once you have your code debugged and working, test it on progressively larger worlds. Keep track of the number of nodes expanded on average for worlds of different sizes and the total search time for those worlds (real time).

Suppose that you had to choose between the reactive agent you designed for the first program and the search-based agent you just created. Assume that the various actions that the vacuum takes take approximately 10 seconds in real time. (1) How large would the vacuum world have to be before the reactive agent started outperforming the search agent (assuming no furniture)? (2) What environmental factors will affect this tradeoff?

Given that the search agent always has more information than the reactive agent, it should always be able to outperform it. Suggest a strategy that would enable the search-based agent to do this. Now implement it. To do this you will need new versions of Percept.cc, Percept.hh and main.cc, all of which can be found in ~echown/courses/370/vacworld/lib In addition to the scoring provided, assume that there is a penalty for computer time spent on search along the lines of the tradeoff you determined already.

Finally, how would your solution change if the agent did not have constant access to the state of the environment? (3) In particular, what if the new perception information cost the agent an action? (4) What if the world changed with some probability X (e.g. new dirt appeared, or furniture changed location)?

2. What to turn in

You will need to turn in the code for the pure-search based agent, as well as the code for the optimal agent. In addition, turn in a trace of each agent running on a small environment (e.g. 4X4) which should include at least some furniture. The code should be turned in by email as well as hard copy. Hand in hard copy answers to all of the questions posed above.

As always your code should clearly explain what it is doing. In particular, clearly spell out the strategy used by your optimal agent. Remember, it should work in ANY sized environment, not just the sizes encoded in the program. Last updated TH Sep 24 21:20:38 1998 echown