vacworld
Class VacuumWorld

java.lang.Object
  extended by agent.Environment
      extended by vacworld.VacuumWorld

public class VacuumWorld
extends Environment

A simulator for the vacuum cleaning world environment. This environment is inaccessible, deterministic, static and discrete.


Constructor Summary
VacuumWorld()
           
VacuumWorld(boolean interactive)
           
VacuumWorld(java.io.PrintStream output, boolean interactive)
           
 
Method Summary
 void addAgent(Agent agent)
          Add a new agent to the environment.
 int getPerformanceMeasure(Agent ag)
          Returns the performance measure of the agent in the current environment.
 int getTeamPerformanceMeasure()
          Returns the performance measure of an agent team in the current environment.
static void main(java.lang.String[] args)
          Runs the program.
 void start(State initState)
          Starts the simulation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VacuumWorld

public VacuumWorld()

VacuumWorld

public VacuumWorld(boolean interactive)

VacuumWorld

public VacuumWorld(java.io.PrintStream output,
                   boolean interactive)
Method Detail

addAgent

public void addAgent(Agent agent)
Add a new agent to the environment. Since the vacuum cleaning world is a single agent environment, this method should only be called once per object.

Specified by:
addAgent in class Environment

start

public void start(State initState)
Starts the simulation. We override the method in agent.Environment so that VacuumWorld states can be displayed to a selected output stream.

Overrides:
start in class Environment

main

public static void main(java.lang.String[] args)
Runs the program. The usage is:
 java vacworld.VacuumWorld [-batch] [-rand integer] agentpack
 
The package containing the agent code (the VacAgent class) must be specified as a command-line parameter. By default, it runs in interactive mode, requiring the user to press a key after each action. To run in batch mode, use the -batch switch. To test the agent in different configurations, use the -rand seed argument, where seed is an integer to be used by the pseudo-random number generator.


getTeamPerformanceMeasure

public int getTeamPerformanceMeasure()
Returns the performance measure of an agent team in the current environment. Since there is only one agent, we just return that agent's performance measure.

Specified by:
getTeamPerformanceMeasure in class Environment

getPerformanceMeasure

public int getPerformanceMeasure(Agent ag)
Returns the performance measure of the agent in the current environment. Since there is only one agent, the ag parameter is ignored.

Specified by:
getPerformanceMeasure in class Environment