vacworld
Class TurnRight

java.lang.Object
  extended by agent.Action
      extended by vacworld.TurnRight

public final class TurnRight
extends Action

A vacuum cleaning world action that causes the agent to turn 90 degrees to the right.


Constructor Summary
TurnRight()
           
 
Method Summary
 State execute(Agent a, State s)
          Return the state that results from the agent turning right in the given state.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TurnRight

public TurnRight()
Method Detail

execute

public State execute(Agent a,
                     State s)
Return the state that results from the agent turning right in the given state. In order to avoid creating unnecessary objects, we do not create a new state, but instead modify the old one. This would have to change if the Environment needs to maintain a history of states.

Specified by:
execute in class Action

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object