CMSC 310 Artificial Intelligence

Homework 01, due 01/28

Consider the agent and its environment in the Wumpus world. The environment in the Wumpus world consists of a rectangle cave size M x N, built up of square cells (M x N number of cells.) The objects in the environment are: a wumpus, a pile of gold, and a number of pits. Each cell may contain either the wumpus, or the gold, or a pit. The rules of the game are:

·  Initially the agent is in the top left cell with coordinates [0][0]. This cell does not contain any objects of the environment.

·  The agent moves through the cells with the purpose to find the gold. From a given cell the agent can move North, South, East, or West, provided that it stays within the cave. We assume that the agent knows the dimensions of the cave.

·  The agent has a weapon and can shoot from its current position North, South, East or West.

·  In each cell the agent receives percepts described below.

Breeze: if there is a pit in at least one of the surrounding cells
Stench: if the wumpus is in one of the surrounding cells
Glitter: if the cell contains the pile of gold
Scream: if agent's previous action was shooting and the wumpus is dead.

·  The agent dies if it enters a cell with the wumpus or a pit.

·  If the agent enters the cell containing the gold, it picks up the gold and exits (in a sequence of moves) the cave.

The agent chooses its action based on the percepts received from the environment.
Assume that the wumpus does not move. This is a simplified version of the problem as described in AIMA textbook.

1.  Design the representation of the environment. Decide on how the agent and the environment objects will be represented. Describe the representation. Give an example. (20 pts)

2.  Develop a method that will generate randomly a square cave M x M with 5 £ M £ 10 with the number of pits between 5% and 10% of the number of cells in the cave. The agent should be located in the top left cell of the cave. (25 pts)

3.  Develop a method that prints the representation of the cave. The print should be user-friendly, i.e. by looking at the print we should be able to locate the pits, the wumpus and the agent. (15 pts)

4.  Develop a main method that will call the methods above. (15 pts)

5.  Design the representations of the percepts. In what form the environment will send the percepts to the agent? Note that there may be more than one percept at a given step. (15 pts)

6.  While working on this assignment, you will have to make various choices (for example, would the percepts be represented as list, by an array, by a single variable with different values, by a set of variables?). Please record the choices that you have considered for each task above, your thought about each choice and why you made a particular choice. (10 pts)

You may choose any programming language to implement tasks 2, 3, and 4. If you do not choose Java, Python or C#, you need to provide the executable.

Give the solutions of tasks 1, 5, and 6 above in a WORD document and don’t forget to write your name at the top of the document. Name the files so that they start with your first name. Save all program files and the word document in a folder and let its name start with your first name. Zip the folder and upload to Scholar.

2