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.
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
- See Also:
- Primitive, Terminal
-
Mow(Mower)
- Create a new Mow terminal which controls the specified lawn mower.
-
evaluateObject(Individual)
- Evaluates this Terminal, causing the mower to move forward one sqaure,
cutting the grass on that square.
-
instance()
- Creates a new instance of this Object.
-
toString()
- Returns a String representation of this Terminal.
Mow
public Mow(Mower mower)
- Create a new Mow terminal which controls the specified lawn mower.
- Parameters:
- mower - The mower to be controlled.
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
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 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