|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--gpsys.Primitive
|
+--gpsys.Function
|
+--gpsys.primitives.If
<TypeX> if (BOOLEAN condition, <typeX> trueValue, <typeX> falseValue)If is a generic function that conditionally evaluates one of two arguments. The function evaluates the first argument (which is of Type BOOLEAN). If the result is true, then the result of evaluating the second argument is returned, otherwise the result of evaluating the third argument is returned. The second and third arguments must be of the same type. If needs to be Type instantiated during construction to work with particular argument Types. The supported argument Types include BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, CHAR and BOOLEAN.
Type,
Primitive,
Function, Serialized Form| Fields inherited from class gpsys.Function |
argTypes |
| Fields inherited from class gpsys.Primitive |
type |
| Constructor Summary | |
If(Type returnType)
Constructs an If Function that works with the specified Type. |
|
| Method Summary | |
boolean |
evaluateBoolean(Individual i,
Gene[] arguments)
Used to conditionally evaluate arguments of BOOLEAN Types. |
byte |
evaluateByte(Individual i,
Gene[] arguments)
Used to conditionally evaluate arguments of BYTE Types. |
char |
evaluateChar(Individual i,
Gene[] arguments)
Used to conditionally evaluate arguments of CHAR Types. |
double |
evaluateDouble(Individual i,
Gene[] arguments)
Used to conditionally evaluate arguments of DOUBLE Types. |
float |
evaluateFloat(Individual i,
Gene[] arguments)
Used to conditionally evaluate arguments of FLOAT Types. |
int |
evaluateInt(Individual i,
Gene[] arguments)
Used to conditionally evaluate arguments of INT Types. |
long |
evaluateLong(Individual i,
Gene[] arguments)
Used to conditionally evaluate arguments of LONG Types. |
java.lang.Object |
evaluateObject(Individual i,
Gene[] arguments)
Used to conditionally evaluate arguments of OBJECT Types. |
short |
evaluateShort(Individual i,
Gene[] arguments)
Used to conditionally evaluate arguments of SHORT Types. |
Primitive |
instance()
Creates an If Object of the same type. |
java.lang.String |
toString()
Returns a String representation of this Function. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public If(Type returnType)
type - The Type of this If Function.| Method Detail |
public final java.lang.Object evaluateObject(Individual i,
Gene[] arguments)
throws EvaluationException
i - The individual being evaluated.arguments - The Gene trees representing the arguments to be
conditionally evaluated.
public final byte evaluateByte(Individual i,
Gene[] arguments)
throws EvaluationException
i - The individual being evaluated.arguments - The Gene trees representing the arguments to be
conditionally evaluated.
public final short evaluateShort(Individual i,
Gene[] arguments)
throws EvaluationException
i - The individual being evaluated.arguments - The Gene trees representing the arguments to be
conditionally evaluated.
public final int evaluateInt(Individual i,
Gene[] arguments)
throws EvaluationException
i - The individual being evaluated.arguments - The Gene trees representing the arguments to be
conditionally evaluated.
public final long evaluateLong(Individual i,
Gene[] arguments)
throws EvaluationException
i - The individual being evaluated.arguments - The Gene trees representing the arguments to be
conditionally evaluated.
public final float evaluateFloat(Individual i,
Gene[] arguments)
throws EvaluationException
i - The individual being evaluated.arguments - The Gene trees representing the arguments to be
conditionally evaluated.
public final double evaluateDouble(Individual i,
Gene[] arguments)
throws EvaluationException
i - The individual being evaluated.arguments - The Gene trees representing the arguments to be
conditionally evaluated.
public final char evaluateChar(Individual i,
Gene[] arguments)
throws EvaluationException
i - The individual being evaluated.arguments - The Gene trees representing the arguments to be
conditionally evaluated.
public final boolean evaluateBoolean(Individual i,
Gene[] arguments)
throws EvaluationException
i - The individual being evaluated.arguments - The Gene trees representing the arguments to be
conditionally evaluated.public final Primitive instance()
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||