All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.Function
java.lang.Object
|
+----gpsys.Primitive
|
+----gpsys.Function
- public abstract class Function
- extends Primitive
The super class of all GP functions. A Function is a GP Primitive that
takes arguments. This abstract class should be extended to create
your own functions. One or more of the evaulation methods
should be overridden to create the desired functionality. The reason
the evaulation methods have not been declared abstract is to relieve
the burden of subclasses having to define all of the different evaluation
methods, when only one is needed.
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
- See Also:
- Primitive, primitives
-
argTypes
- The types of each argument that this function takes.
-
Function()
-
-
evaluateBoolean(Individual, Gene[])
- To be overridden by Functions returning a boolean when evaluated.
-
evaluateByte(Individual, Gene[])
- To be overridden by Functions returning a byte when evaluated.
-
evaluateChar(Individual, Gene[])
- To be overridden by Functions returning a char when evaluated.
-
evaluateDouble(Individual, Gene[])
- To be overridden by Functions returning a double when evaluated.
-
evaluateFloat(Individual, Gene[])
- To be overridden by Functions returning a float when evaluated.
-
evaluateInt(Individual, Gene[])
- To be overridden by Functions returning an int when evaluated.
-
evaluateLong(Individual, Gene[])
- To be overridden by Functions returning a long when evaluated.
-
evaluateObject(Individual, Gene[])
- To be overridden by Functions returning an Object when evaluated.
-
evaluateShort(Individual, Gene[])
- To be overridden by Functions returning a short when evaluated.
argTypes
public Type argTypes[]
- The types of each argument that this function takes. The length of
this array therefore specifies the number of arguments.
Function
public Function()
evaluateObject
public Object evaluateObject(Individual i,
Gene arguments[]) throws EvaluationException
- To be overridden by Functions returning an Object when evaluated.
- Parameters:
- i - the individual that is being evaluated.
- arguments - the arguments supplied to the Function.
- Returns:
- A reference to an Object which is the evaluation result.
- Throws: EvaluationException
- If this method is called.
evaluateByte
public byte evaluateByte(Individual i,
Gene arguments[]) throws EvaluationException
- To be overridden by Functions returning a byte when evaluated.
- Parameters:
- i - the individual that is being evaluated.
- arguments - the arguments supplied to the Function.
- Returns:
- A byte which is the evaluation result.
- Throws: EvaluationException
- If this method is called.
evaluateShort
public short evaluateShort(Individual i,
Gene arguments[]) throws EvaluationException
- To be overridden by Functions returning a short when evaluated.
- Parameters:
- i - the individual that is being evaluated.
- arguments - the arguments supplied to the Function.
- Returns:
- A short which is the evaluation result.
- Throws: EvaluationException
- If this method is called.
evaluateInt
public int evaluateInt(Individual i,
Gene arguments[]) throws EvaluationException
- To be overridden by Functions returning an int when evaluated.
- Parameters:
- i - the individual that is being evaluated.
- arguments - the arguments supplied to the Function.
- Returns:
- An int which is the evaluation result.
- Throws: EvaluationException
- If this method is called.
evaluateLong
public long evaluateLong(Individual i,
Gene arguments[]) throws EvaluationException
- To be overridden by Functions returning a long when evaluated.
- Parameters:
- i - the individual that is being evaluated.
- arguments - the arguments supplied to the Function.
- Returns:
- A long which is the evaluation result.
- Throws: EvaluationException
- If this method is called.
evaluateFloat
public float evaluateFloat(Individual i,
Gene arguments[]) throws EvaluationException
- To be overridden by Functions returning a float when evaluated.
- Parameters:
- i - the individual that is being evaluated.
- arguments - the arguments supplied to the Function.
- Returns:
- A float which is the evaluation result.
- Throws: EvaluationException
- If this method is called.
evaluateDouble
public double evaluateDouble(Individual i,
Gene arguments[]) throws EvaluationException
- To be overridden by Functions returning a double when evaluated.
- Parameters:
- i - the individual that is being evaluated.
- arguments - the arguments supplied to the Function.
- Returns:
- A double which is the evaluation result.
- Throws: EvaluationException
- If this method is called.
evaluateChar
public char evaluateChar(Individual i,
Gene arguments[]) throws EvaluationException
- To be overridden by Functions returning a char when evaluated.
- Parameters:
- i - the individual that is being evaluated.
- arguments - the arguments supplied to the Function.
- Returns:
- A char which is the evaluation result.
- Throws: EvaluationException
- If this method is called.
evaluateBoolean
public boolean evaluateBoolean(Individual i,
Gene arguments[]) throws EvaluationException
- To be overridden by Functions returning a boolean when evaluated.
- Parameters:
- i - the individual that is being evaluated.
- arguments - the arguments supplied to the Function.
- Returns:
- A boolean which is the evaluation result.
- Throws: EvaluationException
- If this method is called.
All Packages Class Hierarchy This Package Previous Next Index