|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--wworld.Environment
This class contains the information about the objects and agents that are contained within the wumpus world grid. It provides methods to retrieve and manipulate the information contained within it.
Constructor Summary | |
Environment()
Constructor |
Method Summary | |
java.util.Vector[][] |
getGridImage()
Returns the gridImage representing the Wumpus World environment. |
java.util.Vector |
getObjectAtLocation(int x,
int y)
Returns the vector of objects at grid location (x, y). |
int |
getSize()
Returns the dimension of the world. |
int |
getWumpusAt(GridPoint gp)
Returns an integer indicating the position of a wumpus at a certain gridpoint, if at all the location contains a wumpus. |
int |
getWumpusFacing(GridPoint gp)
Returns the direction or facing of the wumpus if there is a wumpus at (x, y). |
boolean |
isDeadly(GridPoint gp)
Determines if a grid location is deadly for any agent entering it. |
boolean |
isGoldAt(GridPoint gp)
Returns true if there is gold at the grid location gp. |
boolean |
isGoldAt(int x,
int y)
Returns true if there is gold at the location (x,y) |
boolean |
isObstacleAt(int x,
int y)
Returns true if there is a obstacle at location (x, y). |
boolean |
isPitAt(int x,
int y)
Returns true if there is a pit at location (x, y). |
boolean |
isPitNear(GridPoint gp)
Returns true if there is a pit in the 4 squares surrounding the grid point. |
boolean |
isValid(GridPoint gp)
Determines whether a given gridpoint is within the bounds of the world. |
boolean |
isWumpusAt(int x,
int y)
Returns true if there is a wumpus at (x, y). |
boolean |
isWumpusNear(GridPoint gp)
Returns true if there is a wumpus in the 4 squares surrounding the grid point. |
void |
printEnvironment()
Prints out the summary of the environment on standard output. |
void |
processWumpi()
Positions the wumpii to their next calculated location. |
void |
readWorld(java.io.BufferedReader in)
Reads in the environment from the input stream in and sets the gridimage according to the objects in the world |
void |
readWorldFromFile(java.lang.String fileName)
Populates the environment after reading it from file. |
void |
removeGoldAt(GridPoint gp)
Removes gold pieces at location gp. |
void |
setSize(int s)
Sets the size of the world. |
void |
setWumpusTargets()
Sets targets for wumpii which have a mode that requires them to move to other locations with specific properties. |
boolean |
shootAtWumpus(GridPoint pt,
int orientation)
Processes the shooting of a wumpus from a location pt by an agent. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Environment()
Method Detail |
public int getSize()
public java.util.Vector[][] getGridImage()
public void printEnvironment()
public void setSize(int s)
public boolean isValid(GridPoint gp)
public boolean isDeadly(GridPoint gp)
public java.util.Vector getObjectAtLocation(int x, int y)
x
- and y parameters of the location
public void readWorld(java.io.BufferedReader in) throws java.io.IOException
java.io.IOException
public void setWumpusTargets()
public boolean isWumpusAt(int x, int y)
public int getWumpusFacing(GridPoint gp)
public boolean isWumpusNear(GridPoint gp)
public int getWumpusAt(GridPoint gp)
public void processWumpi()
public boolean shootAtWumpus(GridPoint pt, int orientation)
public boolean isPitAt(int x, int y)
public boolean isPitNear(GridPoint gp)
public boolean isGoldAt(GridPoint gp)
public boolean isGoldAt(int x, int y)
public boolean isObstacleAt(int x, int y)
public void removeGoldAt(GridPoint gp)
public void readWorldFromFile(java.lang.String fileName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |