gpsys.lawnmower
Class Frog

java.lang.Object
  |
  +--gpsys.Primitive
        |
        +--gpsys.Function
              |
              +--gpsys.lawnmower.Frog

public class Frog
extends Function

	Vector2Mod8 Frog(Vector2Mod8 displacement)
 
The Frog Function allows the lawn mower to leap frog by specified X and Y displacements on the lawn. It takes a single Vector2Mod8 argument which represents the displacement and returns the same argument.

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:
Type, Primitive, Terminal, Serialized Form

Field Summary
(package private)  Mower mower
           
 
Fields inherited from class gpsys.Function
argTypes
 
Fields inherited from class gpsys.Primitive
type
 
Constructor Summary
Frog(Mower mower)
          Create a Frog object that controls the specified lawn mower.
 
Method Summary
 java.lang.Object evaluateObject(Individual i, Gene[] arguments)
          Evaluates this Function, causing the mower to leap frog by the specified displacement.
 Primitive instance()
          Creates a new instance of this Object.
 java.lang.String toString()
          Returns a String representation of this Function.
 
Methods inherited from class gpsys.Function
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

Mower mower
Constructor Detail

Frog

public Frog(Mower mower)
Create a Frog object that controls the specified lawn mower.
Parameters:
mower - The Mower to move.
Method Detail

evaluateObject

public final java.lang.Object evaluateObject(Individual i,
                                             Gene[] arguments)
                                      throws EvaluationException
Evaluates this Function, causing the mower to leap frog by the specified displacement.
Parameters:
i - The individual being evaluated.
arguments - The Gene tree representing the displacement.
Returns:
An Object (actually a Vector2Mod8) representing the displacement.
Throws:
EvaluationException - If there is an evaluation failure.
Overrides:
evaluateObject in class Function

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 Function.
Returns:
A String containing the name of the Function.
Overrides:
toString in class Primitive