All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gpsys.lawnmower.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:
1.1, 30th June '97
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
See Also:
Primitive, Terminal

Constructor Index

 o Mow(Mower)
Create a new Mow terminal which controls the specified lawn mower.

Method Index

 o evaluateObject(Individual)
Evaluates this Terminal, causing the mower to move forward one sqaure, cutting the grass on that square.
 o instance()
Creates a new instance of this Object.
 o toString()
Returns a String representation of this Terminal.

Constructors

 o Mow
 public Mow(Mower mower)
Create a new Mow terminal which controls the specified lawn mower.

Parameters:
mower - The mower to be controlled.

Methods

 o evaluateObject
 public final 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
 o 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
 o toString
 public String toString()
Returns a String representation of this Terminal.

Returns:
A String containing the name of the Terminal.
Overrides:
toString in class Primitive

All Packages  Class Hierarchy  This Package  Previous  Next  Index