FJK Home CPE/CSC 480 Syllabus Schedule Lecture Notes Assignments Labs Project Other Links
CPE/CSC 480-F05 Artificial Intelligence
Points 25
Deadline Thu, Oct. 27, midnight (23:59:59)

CPE/CSC 480-F05 Artificial Intelligence Assignment 2: Search Methods

In the second assignment, you will explore various aspects of search methods. Your task is to program an agent that systematically investigates its environment by using some of the search methods discussed in class.

The Agent Environment

The emphasis in this assignment lies on the search methods, and not on the programming of the environment. You will use the Bot Environment that was also used in previous lab exercises. Make sure to check Blackboard for updates or other information on the environment.

Search Methods

In this assignment, you have to implement the following search methods:

  1. uniform-cost (lowest-cost-first) search
  2. greedy best-first search
  3. A* search

The task of the agent is defined as follows: It starts from its initial position (default is the tile in the upper left corner) and has to reach a certain tile identified as the goal position. On its path to the goal, it may have to clean tiles, and the amount of dirt on a tile affects the path cost of the agent. For some of the search methods, the agent needs additional information to estimate the cost from the current node to the goal node. In this case, the agent can ask the field manager for a hint. The manager may provide some hints, such as:

  1. An estimate of the distance between the current and the goal node based on the geometrical properties of the field.
  2. The compass direction of the goal relative to the current position (i.e. North, South, East, West).

These hints, however, incur additional costs for the agent. Usually the costs are higher for more valuable hints. Especially for environments with a known geometry (such as a grid), the agent can often also calculate such hints on its own.

Off-Line vs. On-Line Search

In an artificial environment, it is frequently easy to perform an off-line search by first examining the search space, determining the best (or a "good enough") solution, and then executing the respective actions.

In a real-world setting, the agent might have toperform an on-line search, interleaving the computations to determine the search with the execution of the corresponding steps. In this assignment, you should implement an off-line search. After the agent has identified the goal, it should determine the best possible solution among the ones it explored, perform the actions to achieve the goal, and print it to the display and the log file.

This approach has an important consequence for the agent. When an off-line agent encounters a dead end during its investigation (i.e. there are no uninspected reachable squares from the current square), it can continue its investigation with another square on the fringe easily by "mentally" jumping to that square. An on-line agent, however, has to back up and retrace its steps in order to reach the next square on the fringe, thus increasing the path cost considerably. When you calculate the cost, make sure to differentiate between the search cost and the path cost.

Practical Aspects

The agents must keep track of the tiles it has already examined, and for some search methods, it must be able to backtrack (retrace its steps). The agent should build a data structure that tracks the path it has taken so far, allowing it to retrace its steps. The agent can also construct its own internal map, which may make navigation considerably easier. Again, please note that the agent does not know all relevant aspects of the environment in advance, such as the dimension of the playground, or the placement of obstacles.

Testing and Evaluation

We will use MediumMap.sbm as the main reference for the evaluation of your programs. You should test your agent on other maps as well, however, and we may also use other maps for evaluation purposes.

The search and movement costs for the agent can be obtained via the getMovementCost() and getSearchCost() methods in Bot and BotSearch, respectively. You also need to include the costs for hints that you obtain from the environment.

For the cost calculations, the following numbers are used:

Your program must provide the following information:

This information should be displayed for every step, and written into a log file for later analysis. Also add the configuration of the field and the search method used to your log file.

Extra Credit Opportunities

The grader and I are currently discussing possible refinements and extensions for the environment. This could also be an opportunity for extra credit, e.g. using different graphics, or adding functionality. If you have any ideas, let us know. We will also post more information on Blackboard.

Assignment Submission

This assignment must be submitted electronically via the handin program on hornet. Please make sure that you have a functioning account on hornet. Follow this link for directions. You need to submit the following items:

Naming Conventions

Please use your Cal Poly login as the first part of your agent's name, and an indication of the search method as the second. For example, my greedy agent would be something like fkurfess-greedy. This will allow us to keep all agents in the Agents directory, without having to edit your files or moving files back and forth when we do the grading.

Questions about the Assignment

If you have gneral questions or comments concerning the programming aspects of the homework, post them on the Blackboard Discussion Forum for the assignment. The grader and I will check that forum on a regular basis, and try to answer your questions.

FJK Home CPE/CSC 480 Syllabus Schedule Lecture Notes Assignments Labs Project Other Links
Assignment-2.shtml
last modified:
Friday, October, 21, 2005, 09:03:46 PDT
© 2000-2025
Franz Kurfess