vacworld
Class GoForward

java.lang.Object
  extended byagent.Action
      extended byvacworld.GoForward

public class GoForward
extends Action

A vacuum cleaning agent action that causes the agent to advance one step.


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

Constructor Detail

GoForward

public GoForward()
Method Detail

execute

public State execute(Agent a,
                     State s)
Return the state that results from the agent moving forward in the given state. In order to avoid creating unecessary 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()