CS370 Program 1 (Due September 23, 1998)

In this assignment, you will design and implement a rule-based agent for the vacuum-cleaner world. The full vacuum-cleaner world is described in Chapter 2 problem 2.5. The world has already been implemented in an extensive package of code described below. You will need to become familiar with this code during the course.

1. Assignment

The environment is implemented as an m by n rectangular room where each square has a 20% 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. This means that the agent will not know the size of the room when it first starts up.

First, implement a purely reactive agent which makes its decision based only upon the percepts it receives from the environment. There are random and reactive vacuums in:

~echown/ai2cpp/code/vacuum/players/

See if you can improve upon the average score these agents get. Then implement an agent with internal state that sucks up all of the dirt, returns to its home position, and shuts off. You will need to decide what state information the agent needs to maintain. You can define your agent by specializing the existing general player class.

The file

~echown/ai2cpp/code/vacuum/README

contains extensive information on how to compile and run the agent simulation. Please note that it is possible to have more than one "unit" of dirt within a cell. Hence, after doing a "suck" action, there may still be dirt in the cell.

While debugging your agent, I suggest that you constrain the world to be fairly small (e.g., 4 by 4). It may also be useful to create small test worlds during debugging. The README file describes how to do this and there is an example in:

~echown/ai2cpp/code/vacuum/testworld

When you have your agent debugged, you should compare its performance to the reactive agent which is based upon code provided by Russell and Norvig. Do at least 20 runs and provide the average results.

2. What to turn in

You should turn in your code, a trace of your agent running on a small (e.g., 4 by 4) environment, and a trace of the agent-trials run. Your code should clearly explain what it is doing. In particular, please explain the meaning of each of your state variables. You should try to get a good score on the performance criterion (which gives 100 points for each dirt object you vacuum up, -1 point for each action, and -1000 points if the agent is not in its home location when it shuts off). Please email your solution to me (echown@bowdoin.edu) and also turn in a hardcopy at the start of class. In addition, provide a short discussion the generality of your solution where you address the following questions: 1) What happens if the vacuum starts in a random location? 2) What happens if we allow furniture into the environment?

3. Agent Code for Russell and Norvig

The directory ~echown/ai2cpp/code/vacuum/lib is the directory for a package of C++ routines written by Larry Holder of the University of Texas at Arlington. One purpose of the assignement is for you to begin to familiarize yourself with this code. The basic environment package included in the code will be used in subsequent assignments. If you have any questions about the code feel free to ask me about it.

Last updated Mon Sep 7 21:20:38 1998 echown