wworld
Class Percept

java.lang.Object
  |
  +--wworld.Percept

public class Percept
extends java.lang.Object

Specifies the object containing various percepts. The percepts include extended percepts, natural language percepts and image percepts.


Constructor Summary
Percept(int clientNo)
          Constructor.
 
Method Summary
 void createAgentImage(int imageX, int imageY, int agentFacing)
           
 void createGoldImage(int imageX, int imageY)
           
 void createObstacleImage(int imageX, int imageY)
           
 void createPitImage(int imageX, int imageY)
           
 void createWumpusImage(int imageX, int imageY, int wumpusFacing)
           
 java.lang.String getHint()
           
 int getImageHeight()
          Returns the height of the image being sent to the agent.
 int[][][] getImagePixels()
          Returns the array containing pixel values of the image being sent as a percept to the client.
 int getImageWidth()
          Returns the width of the image being sent to the agent.
 boolean isBreeze()
          Returns true if the agent feels a breeze.
 boolean isBump()
          Returns true if the agent bumped into a wall in the previous step.
 boolean isGlitter()
          Returns true if the agent senses a glitter.
 boolean isScream()
          Returns true if the agent hears a wumpus die.
 boolean isStench()
          Returns true if the agent smells the wumpus.
 void perceive(Environment env, GridPoint gp, int orientation, java.util.Vector allAgents, TransferPercept tp)
          Used to set the percepts for each agent depending on their position and orientation in the grid.
 void readImage(java.io.FileInputStream is, int imageX, int imageY)
          Reads the image from a file given that the file contains an image in ascii PPM format.
 void setBumpedLastTime()
          Used to indicate that in the last step, the agent tried to walk into a wall or an obstacle.
 void setWumpusDiedLastTime()
          Used to indicate that in the last step, the agent shot a wumpus.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Percept

public Percept(int clientNo)
Constructor. Initializes various percepts.

Method Detail

perceive

public void perceive(Environment env,
                     GridPoint gp,
                     int orientation,
                     java.util.Vector allAgents,
                     TransferPercept tp)
Used to set the percepts for each agent depending on their position and orientation in the grid. The Vector containing all the other agents is needed to calculate the natural language hints.


createWumpusImage

public void createWumpusImage(int imageX,
                              int imageY,
                              int wumpusFacing)

createAgentImage

public void createAgentImage(int imageX,
                             int imageY,
                             int agentFacing)

createGoldImage

public void createGoldImage(int imageX,
                            int imageY)

createPitImage

public void createPitImage(int imageX,
                           int imageY)

createObstacleImage

public void createObstacleImage(int imageX,
                                int imageY)

getImagePixels

public int[][][] getImagePixels()
Returns the array containing pixel values of the image being sent as a percept to the client. int[][][0] contains the red pixel values, int[][][1] contains the green pixel values and int[][][2] contains the blue pixel values.


getImageHeight

public int getImageHeight()
Returns the height of the image being sent to the agent.


getImageWidth

public int getImageWidth()
Returns the width of the image being sent to the agent.


readImage

public void readImage(java.io.FileInputStream is,
                      int imageX,
                      int imageY)
Reads the image from a file given that the file contains an image in ascii PPM format.


setBumpedLastTime

public void setBumpedLastTime()
Used to indicate that in the last step, the agent tried to walk into a wall or an obstacle.


setWumpusDiedLastTime

public void setWumpusDiedLastTime()
Used to indicate that in the last step, the agent shot a wumpus.


isBreeze

public boolean isBreeze()
Returns true if the agent feels a breeze.


isStench

public boolean isStench()
Returns true if the agent smells the wumpus.


isGlitter

public boolean isGlitter()
Returns true if the agent senses a glitter.


isBump

public boolean isBump()
Returns true if the agent bumped into a wall in the previous step.


isScream

public boolean isScream()
Returns true if the agent hears a wumpus die.


getHint

public java.lang.String getHint()