All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.primitives.Mul
java.lang.Object
|
+----gpsys.Primitive
|
+----gpsys.Function
|
+----gpsys.primitives.Mul
- public class Mul
- extends Function
<typeX> Mul(<typeX> num1, <typeX> num2)
Mul is a generic function that returns the result of multiplying both
arguments.
Mul needs to be Type instantiated during construction to work with
particular argument Types. The supported argument Types include BYTE,
SHORT, INT, LONG, FLOAT and DOUBLE.
- Version:
- 1.1, 30th June '97
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
- See Also:
- Type, Primitive, Function
-
Mul(Type)
- Constructs a Mul Function that works with the specified Type.
-
evaluateByte(Individual, Gene[])
- Used to multiply arguments of BYTE Types.
-
evaluateDouble(Individual, Gene[])
- Used to multiply arguments of DOUBLE Types.
-
evaluateFloat(Individual, Gene[])
- Used to multiply arguments of FLOAT Types.
-
evaluateInt(Individual, Gene[])
- Used to multiply arguments of INT Types.
-
evaluateLong(Individual, Gene[])
- Used to multiply arguments of LONG Types.
-
evaluateShort(Individual, Gene[])
- Used to multiply arguments of SHORT Types.
-
instance()
- Creates an instance of this Mul object.
-
toString()
- Returns a String representation of this Function.
Mul
public Mul(Type type)
- Constructs a Mul Function that works with the specified Type. The
supported Types include BYTE, SHORT, INT, LONG, FLOAT and DOUBLE.
- Parameters:
- type - The Type of this Mul Function.
evaluateByte
public final byte evaluateByte(Individual i,
Gene arguments[]) throws EvaluationException
- Used to multiply arguments of BYTE Types.
- Parameters:
- i - The individual being evaluated.
- arguments - The Gene trees representing the arguments to be added.
- Returns:
- A byte representing the product of the arguments.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateByte in class Function
evaluateShort
public final short evaluateShort(Individual i,
Gene arguments[]) throws EvaluationException
- Used to multiply arguments of SHORT Types.
- Parameters:
- i - The individual being evaluated.
- arguments - The Gene trees representing the arguments to be added.
- Returns:
- A short representing the product of the arguments.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateShort in class Function
evaluateInt
public final int evaluateInt(Individual i,
Gene arguments[]) throws EvaluationException
- Used to multiply arguments of INT Types.
- Parameters:
- i - The individual being evaluated.
- arguments - The Gene trees representing the arguments to be added.
- Returns:
- An int representing the product of the arguments.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateInt in class Function
evaluateLong
public final long evaluateLong(Individual i,
Gene arguments[]) throws EvaluationException
- Used to multiply arguments of LONG Types.
- Parameters:
- i - The individual being evaluated.
- arguments - The Gene trees representing the arguments to be added.
- Returns:
- A long representing the product of the arguments.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateLong in class Function
evaluateFloat
public final float evaluateFloat(Individual i,
Gene arguments[]) throws EvaluationException
- Used to multiply arguments of FLOAT Types.
- Parameters:
- i - The individual being evaluated.
- arguments - The Gene trees representing the arguments to be added.
- Returns:
- A float representing the product of the arguments.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateFloat in class Function
evaluateDouble
public final double evaluateDouble(Individual i,
Gene arguments[]) throws EvaluationException
- Used to multiply arguments of DOUBLE Types.
- Parameters:
- i - The individual being evaluated.
- arguments - The Gene trees representing the arguments to be added.
- Returns:
- A double representing the product of the arguments.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateDouble in class Function
instance
public final Primitive instance()
- Creates an instance of this Mul object. The Type instantiation is
preserved so that if an INT Mul is being cloned, the clone will also be
INT instantiated.
- Returns:
- A reference to this Object (yes the same object, since
the type information is to be the same, there are therefore
no instance variables to be modified.
- Overrides:
- instance in class Primitive
toString
public String toString()
- Returns a String representation of this Function.
- Returns:
- A String containing the name of the Function.
- Overrides:
- toString in class Primitive
All Packages Class Hierarchy This Package Previous Next Index