gpsys.lawnmower
Class Mow

java.lang.Object
  |
  +--gpsys.Primitive
        |
        +--gpsys.Terminal
              |
              +--gpsys.lawnmower.Mow

public class Mow
extends Terminal

 Vector2Mod8 Mow
 
A Terminal that instructs the lawnmower to move forward by one square, cutting any grass on that square.

Version:
$Revision: 1.1 $, $Date: 2000/07/05 16:26:49 $
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
See Also:
Primitive, Terminal, Serialized Form

Field Summary
private  Mower mower
          The lawnmower being controlled.
 
Fields inherited from class gpsys.Primitive
type
 
Constructor Summary
Mow(Mower mower)
          Create a new Mow terminal which controls the specified lawn mower.
 
Method Summary
 java.lang.Object evaluateObject(Individual i)
          Evaluates this Terminal, causing the mower to move forward one sqaure, cutting the grass on that square.
 Primitive instance()
          Creates a new instance of this Object.
 java.lang.String toString()
          Returns a String representation of this Terminal.
 
Methods inherited from class gpsys.Terminal
evaluateBoolean, evaluateByte, evaluateChar, evaluateDouble, evaluateFloat, evaluateInt, evaluateLong, evaluateShort
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

mower

private Mower mower
The lawnmower being controlled.
Constructor Detail

Mow

public Mow(Mower mower)
Create a new Mow terminal which controls the specified lawn mower.
Parameters:
mower - The mower to be controlled.
Method Detail

evaluateObject

public final java.lang.Object evaluateObject(Individual i)
                                      throws EvaluationException
Evaluates this Terminal, causing the mower to move forward one sqaure, cutting the grass on that square.
Parameters:
i - The individual being evaluated.
Returns:
An Object (actually a Vector2Mod8) representing the Zero Vector2Mod8.
Throws:
EvaluationException - If there is an evaluation failure.
Overrides:
evaluateObject in class Terminal

instance

public final Primitive instance()
Creates a new instance of this Object.
Returns:
A reference to this same Object since none of the instance variables are to be changed.
Overrides:
instance in class Primitive

toString

public java.lang.String toString()
Returns a String representation of this Terminal.
Returns:
A String containing the name of the Terminal.
Overrides:
toString in class Primitive