wworld
Class Agent

java.lang.Object
  |
  +--wworld.WorldObject
        |
        +--wworld.GridObject
              |
              +--wworld.MovingObject
                    |
                    +--wworld.Actor
                          |
                          +--wworld.Agent

public class Agent
extends Actor

Defines the data and behaviour associated with an Agent. An agent is an alien to the Wumpus World, and is not part of the environment.


Constructor Summary
Agent(int objType, GridPoint gp, int o, int idnumber, java.lang.String name, int maxArr)
           
Agent(int objType, int x, int y, int o, int idnumber, java.lang.String name, int maxArr)
          Constructor.
 
Method Summary
 void act(int action)
          Acts out the actions taken by the agent, and also takes care of the agents' score.
 void addScoreForAction()
           
 void addScoreForDying()
           
 void addScoreForGold()
           
 void decrementArrowCount()
           
 void die(GridPoint gp)
          Handles the agent status and statistics when he dies.
 int getArrowCount()
           
 int getGoldCount()
           
 int getScore()
           
 void incrementGoldCount()
           
 boolean isAgentDoneLastTime()
           
 void reset()
          Used to reset the agent parameters at the end of every trial.
 void setAgentDoneLastTime(boolean yesorno)
           
 
Methods inherited from class wworld.Actor
getActorId, getActorName, getState, setState
 
Methods inherited from class wworld.MovingObject
getOrientation, getOrientationDirection, getOrigOrientation, move, setOrientation, turnLeft, turnRight
 
Methods inherited from class wworld.GridObject
getLocation, getOrigLocation, setLocation, setLocation
 
Methods inherited from class wworld.WorldObject
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Agent

public Agent(int objType,
             int x,
             int y,
             int o,
             int idnumber,
             java.lang.String name,
             int maxArr)
Constructor. The agent can be allowed to have more number of arrows initially by changing the maxarr parameter in this constructor


Agent

public Agent(int objType,
             GridPoint gp,
             int o,
             int idnumber,
             java.lang.String name,
             int maxArr)
Method Detail

reset

public void reset()
Used to reset the agent parameters at the end of every trial.

Overrides:
reset in class WorldObject

getArrowCount

public int getArrowCount()

getGoldCount

public int getGoldCount()

incrementGoldCount

public void incrementGoldCount()

decrementArrowCount

public void decrementArrowCount()

addScoreForAction

public void addScoreForAction()

addScoreForGold

public void addScoreForGold()

addScoreForDying

public void addScoreForDying()

act

public void act(int action)
Acts out the actions taken by the agent, and also takes care of the agents' score.


die

public void die(GridPoint gp)
Handles the agent status and statistics when he dies.


getScore

public int getScore()

isAgentDoneLastTime

public boolean isAgentDoneLastTime()

setAgentDoneLastTime

public void setAgentDoneLastTime(boolean yesorno)