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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
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)