gpsys.lawnmower
Class ADF2

java.lang.Object
  |
  +--gpsys.Primitive
        |
        +--gpsys.Function
              |
              +--gpsys.ADFunction
                    |
                    +--gpsys.lawnmower.ADF2

public class ADF2
extends ADFunction

	Vector2Mod8 ADF2(Vector2Mod8 arg)
 
ADF2 is an automatically defined Function which takes one argument. This is just a wraparound that allows the ADF to be added to the functions set of other ADFs. The actual body of ADF2 is in Chromosome 2 (adf[2]) of an Individual. Note that since the argument to ADF2 occurs in the terminal set of ADF2, it must be treated just like a Terminal, and it is hence defined elsewhere as a terminal.

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, Function, ADFunction, Serialized Form

Field Summary
(package private)  ADF2Arg0 arg0
          A reference to the Terminal defining the argument to this Function.
 
Fields inherited from class gpsys.ADFunction
adfIndex
 
Fields inherited from class gpsys.Function
argTypes
 
Fields inherited from class gpsys.Primitive
type
 
Constructor Summary
ADF2(ADF2Arg0 arg0)
          Create an ADF2 Object.
 
Method Summary
 java.lang.Object evaluateObject(Individual i, Gene[] arguments)
          Evaluate the ADF as one that return an Object (this is necessary since the evaluation actually returns a Vector2Mod8 object).
 Primitive instance()
          Creates an instance of this ADF.
 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

arg0

ADF2Arg0 arg0
A reference to the Terminal defining the argument to this Function.
Constructor Detail

ADF2

public ADF2(ADF2Arg0 arg0)
Create an ADF2 Object.
Parameters:
arg0 - A reference to the Terminal defining the argument to this Function.
Method Detail

evaluateObject

public java.lang.Object evaluateObject(Individual i,
                                       Gene[] arguments)
                                throws EvaluationException
Evaluate the ADF as one that return an Object (this is necessary since the evaluation actually returns a Vector2Mod8 object). Before the adf is evaluated, the value of the terminal representing the argument to this ADF is set to the result of evaluating the argument branch of this ADF.
Parameters:
i - The individual being evaluated.
arguments - The Gene trees representing the arguments to this Function.
Returns:
An Object reference, which is the result of evaluating this Function.
Throws:
EvaluationException - If there is an evaluation failure.
Overrides:
evaluateObject in class Function

instance

public Primitive instance()
Creates an instance of this ADF.
Returns:
A reference to this same Object since none of the instance variables will ever 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