AIILE.gridworld.util.move
Class BaseMove

java.lang.Object
  extended byAIILE.gridworld.util.move.BaseMove
All Implemented Interfaces:
Move

public class BaseMove
extends java.lang.Object
implements Move

A base class of the Move interface. This is currently used by the GridWorld. The fringe methods are not used.


Constructor Summary
BaseMove(Node n)
          Creates a new instance of BaseMove
BaseMove(Node n, java.lang.String d)
           
 
Method Summary
 Node getCurrentNode()
          This returns the current node that moved
 java.lang.String getMoveDirection()
          This will return the direction set by setMoveDirection or by the constructor.
 java.lang.String getShotDirection()
          This returns the node that the arrow was shot to.
 boolean isArrowShot()
          Provides a value of true if the arrow has been shot, false if not.
 boolean isGoldPickedUp()
          This returns true if the gold has been picked up.
 void pickUpGold()
          This is similar to the shootArrow method.
 void setCurrentNode(Node n)
          This sets the current node that moved
 void setMoveDirection(java.lang.String m)
          This allows the agent to set the direction that it wants to go.
 void shootArrow(java.lang.String d)
          This takes the node that the arrow is to be shot at.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseMove

public BaseMove(Node n)
Creates a new instance of BaseMove

Parameters:
n - create a move with a current node

BaseMove

public BaseMove(Node n,
                java.lang.String d)
Method Detail

setCurrentNode

public void setCurrentNode(Node n)
This sets the current node that moved

Specified by:
setCurrentNode in interface Move
Parameters:
n - current node to move

getCurrentNode

public Node getCurrentNode()
This returns the current node that moved

Specified by:
getCurrentNode in interface Move
Returns:
Node

shootArrow

public void shootArrow(java.lang.String d)
This takes the node that the arrow is to be shot at. The environment then checks to see if the Wumpus is in that node. If so then the percept of SCREAM is in the next EnvironmentInfo percept list. If the Wumpus is not in the node then the arrow is used and you do not get another.

Specified by:
shootArrow in interface Move
Parameters:
d - the direction to move to

getShotDirection

public java.lang.String getShotDirection()
This returns the node that the arrow was shot to.

Specified by:
getShotDirection in interface Move
Returns:
String

isArrowShot

public boolean isArrowShot()
Provides a value of true if the arrow has been shot, false if not.

Specified by:
isArrowShot in interface Move
Returns:
boolean

pickUpGold

public void pickUpGold()
This is similar to the shootArrow method. This takes the node that you currently want the gold picked up.

Specified by:
pickUpGold in interface Move

isGoldPickedUp

public boolean isGoldPickedUp()
This returns true if the gold has been picked up.

Specified by:
isGoldPickedUp in interface Move
Returns:
boolean

getMoveDirection

public java.lang.String getMoveDirection()
This will return the direction set by setMoveDirection or by the constructor.

Specified by:
getMoveDirection in interface Move
Returns:
String

setMoveDirection

public void setMoveDirection(java.lang.String m)
This allows the agent to set the direction that it wants to go. This will over ride the constructor direction, if set.

Specified by:
setMoveDirection in interface Move
Parameters:
m - the direction to go