ai.worlds.vacuum
Class VacuumWorld

java.lang.Object
  extended byai.worlds.Environment
      extended byai.worlds.GridEnvironment
          extended byai.worlds.vacuum.VacuumWorld
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Runnable

public class VacuumWorld
extends GridEnvironment

A Vacuum environment.

Author:
Jill Zimmerman -- jill.zimmerman@goucher.edu

Nested Class Summary
 
Nested classes inherited from class ai.worlds.GridEnvironment
GridEnvironment.GridCanvas
 
Field Summary
 
Fields inherited from class ai.worlds.GridEnvironment
canvas, DOWN, grid, LEFT, RIGHT, size, start, UP, visited
 
Fields inherited from class ai.worlds.Environment
agents, display, maxSteps, runner, step
 
Constructor Summary
VacuumWorld(Agent[] a, int xsize, int ysize, double probDirt, javax.swing.JFrame f)
           
 
Method Summary
 java.lang.Object getPercept(Agent a)
          Get the next percept.
 boolean legalAction(java.lang.String a)
          Determine if an action is legal.
 int performanceMeasure(Agent a)
          Determine performance of the agent.
 
Methods inherited from class ai.worlds.GridEnvironment
addObj, clone, contains, copyGrid, fillGrid, fillLoc, forward, getItem, grab, neighbor, removeObj, snapshot, termination, turn, updateEnv
 
Methods inherited from class ai.worlds.Environment
displayEnv, executeAgentActions, run, start, stop, takeStep
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VacuumWorld

public VacuumWorld(Agent[] a,
                   int xsize,
                   int ysize,
                   double probDirt,
                   javax.swing.JFrame f)
Method Detail

legalAction

public boolean legalAction(java.lang.String a)
Determine if an action is legal.

Specified by:
legalAction in class Environment
Parameters:
a - is an action string.

getPercept

public java.lang.Object getPercept(Agent a)
Get the next percept.

Specified by:
getPercept in class Environment
Parameters:
a - is the agent.

performanceMeasure

public int performanceMeasure(Agent a)
Determine performance of the agent.

Specified by:
performanceMeasure in class Environment
Parameters:
a - is the agent.