Table of Contents

Lab 1 - Agents

Problem Description

Implement the control program for a vacuum cleaner agent. The environment is a rectangular grid of cells which may contain dirt or an obstacle. The agent is located somewhere in this grid and facing in one of the four directions: north, south, east or west. The agent can execute the following actions:

The robot is equipped with a dust sensor and a touch sensor. If there is dirt at current location of the robot, the agent will sense “DIRT”. If the robot is bumping into an obstacle, the agent will sense “BUMP”. The goal is to clean all cells and return to the initial location before turning the robot off. Note, a full charge of the battery of the robot will only last for 100 actions.

Tasks

  1. Characterise the environment (is it static or dynamic, deterministic or stochastic, …).
  2. Develop a strategy for the agent such that it cleans every cell and outline the agent function.
  3. Fill out the missing parts of the vacuum cleaner Java program (see below) such that it encodes your agent function.
  4. Test your program with all three provided environments. Record the number of steps it takes to finish each environment and the resulting points.
  5. Is your agent rational? Justify your answer.

To make this a bit easier you can use the following assumptions:

Material

The file contains code for implementing an agent in the src directory. The agent is actually a server process which listens on some port and waits for the real robot or a simulator to send a message. It will then reply with the next action the robot is supposed to execute.

The zip file also contains the description of three example environments (vacuumcleaner*.gdl) and a simulator (gamecontroller-gui.jar). To test your agent:

You can see here, what the example environment looks like. Of course, you shouldn't assume any fixed size, initial location or locations of the dirt in your implementation. This is just an example environment.

Hints

For implementing your agent:

As a general hint: “Days of programming can save you minutes of thinking.” Think of a strategy, the rules to implement it and the information you need to decide on the actions before you start implementing it.

Visualization

There is a server-version of the Gamecontroller (the simulator) here: http://130.208.241.192/ggpserver/

You can register there, then go to “User Profile” and create a new player:

Afterwards you can use this player to play some matches. Of course your agent will only be able to play the vacuum cleaner world. To start a match: