|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectagent.Environment
vacworld.VacuumWorld
A simulator for the vacuum cleaning world environment. This environment is inaccessible, deterministic, static and discrete.
Field Summary | |
protected boolean |
interactive
|
protected int |
numBumps
|
protected int |
numMoves
|
protected int |
numSucks
|
protected int |
numTurns
|
protected java.io.PrintStream |
output
|
protected int |
totalScore
|
Fields inherited from class agent.Environment |
agents, state |
Constructor Summary | |
VacuumWorld()
|
|
VacuumWorld(java.io.PrintStream output,
boolean interactive)
|
Method Summary | |
void |
addAgent(Agent agent)
Add a new agent to the environment. |
protected int |
getNumActions()
Returns the number of actions the agent has executed. |
protected int |
getNumDirtyLocs()
|
protected Percept |
getPercept(Agent a)
Create a percept for an agent. |
protected int |
getPerformanceMeasure()
Returns the performance measure of the agent in the current environment. |
boolean |
gotHome()
Returns true if the robot has turned itself off in its origin square. |
protected boolean |
isComplete()
The simulation is complete when the robot has performed its ShutOff action. |
static void |
main(java.lang.String[] args)
Runs the program. |
protected void |
printScore(java.io.PrintStream out)
|
void |
start(State initState)
Starts the simulation. |
protected void |
updateState(Agent a,
Action action)
Execute an agent's action and update the environment's state. |
protected void |
waitForUser()
Pause simulation until user has pressed a key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int numMoves
protected int numTurns
protected int numSucks
protected int numBumps
protected int totalScore
protected java.io.PrintStream output
protected boolean interactive
Constructor Detail |
public VacuumWorld()
public VacuumWorld(java.io.PrintStream output, boolean interactive)
Method Detail |
public void addAgent(Agent agent)
addAgent
in class Environment
protected boolean isComplete()
isComplete
in class Environment
protected Percept getPercept(Agent a)
getPercept
in class Environment
protected void updateState(Agent a, Action action)
updateState
in class Environment
public void start(State initState)
start
in class Environment
protected void waitForUser()
public static void main(java.lang.String[] args)
protected int getNumDirtyLocs()
public boolean gotHome()
protected int getNumActions()
protected int getPerformanceMeasure()
getPerformanceMeasure
in class Environment
protected void printScore(java.io.PrintStream out)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |