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.
Download
the project files from http://phoenix.goucher.edu/~jillz/cs340/ai/ai.zip. You will need to use Winzip
to extract the files.
You
then should use Eclipse to import the project.
Then compile the files and run the class AI.
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();
You
can compare your agent to the stupid ones provided by using the agent
trials. Simply select the agents to be
in the trials and run the trials. The
average score of trials on identical environments will be displayed.
When
you are satisfied with the intelligence of your vacuum agent, email your source
code file to me at jill.zimmerman@goucher.edu . We will run agent trials in class among all
your agents to see who has the best vacuum.
The top agent will earn bonus points.