ai.worlds.wumpus
Class WumpusWorld
java.lang.Object
ai.worlds.Environment
ai.worlds.GridEnvironment
ai.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
Field Summary |
Wumpus |
w
The single wumpus in the world |
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
w
public Wumpus w
- The single wumpus in the world
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)
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]