CS340    Project 1 -  The Vacuum World


Design a more sophisticated agent for the vacuum world. You may assume that the room the agents are to vacuum is a rectangle with no furniture or other obstacles. You agent may have memory. That is, the agent may have a "state" which can change and remember information from previous steps.


Here is a template that you can use:


// My Vacuum Agent

package ai.worlds.vacuum;

import java.util.*;


class MyVacuumAgent extends VacuumAgent



    // declare any state variables here


    void determineAction()



    /* This method uses the percept (stored in the Vector percept)

       and state values to determine the agents next action.

       The member variable action is assigned a string (either "suck",

       "forward", "turn left", "turn right", or "shut-off") to indicate

       the agent's next action */





Give your vacuum agent class your name followed by VacuumAgent, for example, JillVacuumAgent. The class needs to be contained in file with the same name with the .java extension, for example JillVacuumAgent.java. In order to test out your agent, you will need to add this file to an Eclipse project which contains all the java files that I have provided and then make a couple of small modifications to one of my files.


Your new VacuumAgent file should be placed in the ai.worlds.vacuum package. Also in the ai.worlds package select the file WorldCreatePanel.java and make the following changes to include your agent.

         Add a string with name of your agent to

 String[] vacuumStrings = {"Random Vacuum Agent","Reactive Vacuum Agent"};

         In the method createAgent, add an else if clause before the else like

else if (agentName == "Jill Vacuum Agent")

    return new JillVacuumAgent();



When you are satisfied with the intelligence of your vacuum agent, submit your source code file.