ai.worlds.wumpus
Class WumpusWorld

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

public class WumpusWorld
extends GridEnvironment

The wumpus world environment.

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

Nested Class Summary
 
Nested classes inherited from class ai.worlds.GridEnvironment
GridEnvironment.GridCanvas
 
Field Summary
 Wumpus w
          The single wumpus in the world
 
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
WumpusWorld(Agent[] a, int xsize, int ysize, javax.swing.JFrame f)
           
WumpusWorld(Agent[] a, int xsize, int ysize, javax.swing.JFrame f, java.lang.String filename)
           
 
Method Summary
 java.lang.Object getPercept(Agent a)
          Get the agent percept.
 boolean legalAction(java.lang.String a)
          Determine if an action is legal.
 int performanceMeasure(Agent a)
          Score the performance of the agent.
 boolean termination()
          End when some agent climbs out or for the default reason (everyone dead).
 void updateEnv()
          Turn off all bump flags and execute the agent actions.
 
Methods inherited from class ai.worlds.GridEnvironment
addObj, clone, contains, copyGrid, fillGrid, fillLoc, forward, getItem, grab, neighbor, removeObj, snapshot, turn
 
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
 

Field Detail

w

public Wumpus w
The single wumpus in the world

Constructor Detail

WumpusWorld

public WumpusWorld(Agent[] a,
                   int xsize,
                   int ysize,
                   javax.swing.JFrame f)

WumpusWorld

public WumpusWorld(Agent[] a,
                   int xsize,
                   int ysize,
                   javax.swing.JFrame f,
                   java.lang.String filename)
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 the action string

updateEnv

public void updateEnv()
Description copied from class: GridEnvironment
Turn off all bump flags and execute the agent actions.

Overrides:
updateEnv in class GridEnvironment

termination

public boolean termination()
End when some agent climbs out or for the default reason (everyone dead).

Overrides:
termination in class GridEnvironment

performanceMeasure

public int performanceMeasure(Agent a)
Description copied from class: Environment
Score the performance of the agent.

Specified by:
performanceMeasure in class Environment
Parameters:
a - Agent in the environment

getPercept

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

Specified by:
getPercept in class Environment
Parameters:
a - is the agent.
Returns:
a vector indicating [stench, breeze, glitter, bump, sound]