|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.groovyj.jgprog.Function
|
+--com.groovyj.jgprog.functions.ADF
An automatically defined function (ADF) is a chromosome which takes a number of arguments. Calling an ADF results in setting the arguments and computing the value of the chromosome.
Copyright (c) 2000 Robert Baruch. This code is released under the GNU General Public License (GPL).
| Field Summary | |
int |
chromosomeNum
|
| Fields inherited from class com.groovyj.jgprog.Function |
arity, individual, returnType |
| Constructor Summary | |
ADF(int chromosomeNum,
Type[] argTypes)
Creates an ADF node which will evaluate the given chromosome number and takes the given argument types. |
|
| Method Summary | |
boolean |
execute_boolean(Chromosome c,
int n)
Executes this node as a boolean. |
double |
execute_double(Chromosome c,
int n)
Executes this node as a double. |
float |
execute_float(Chromosome c,
int n)
Executes this node as a float. |
int |
execute_int(Chromosome c,
int n)
Executes this node as an integer. |
long |
execute_long(Chromosome c,
int n)
Executes this node as a long. |
java.lang.Object |
execute_object(Chromosome c,
int n)
Executes this node as an object. |
void |
execute_void(Chromosome c,
int n)
Executes this node, returning nothing. |
Type |
getChildType(int i)
Gets the type of node allowed form the given child number. |
int |
getChromosomeNum()
Get the chromosome number this ADF refers to. |
java.lang.String |
getName()
Gets the name of this node. |
boolean |
isConstant()
|
| Methods inherited from class com.groovyj.jgprog.Function |
execute, getArity, getReturnType, setIndividual, setReturnType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int chromosomeNum
| Constructor Detail |
public ADF(int chromosomeNum,
Type[] argTypes)
chromosomeNum - the chromosome number to evaluateargTypes - the types for the arguments| Method Detail |
public java.lang.String getName()
FunctiongetName in class Functioncom.groovyj.jgprog.Functionpublic int getChromosomeNum()
public boolean execute_boolean(Chromosome c,
int n)
Functionexecute_boolean in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not boolean
public void execute_void(Chromosome c,
int n)
Functionexecute_void in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not void
public int execute_int(Chromosome c,
int n)
Functionexecute_int in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not integer
public long execute_long(Chromosome c,
int n)
Functionexecute_long in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not long
public float execute_float(Chromosome c,
int n)
Functionexecute_float in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not float
public java.lang.Object execute_object(Chromosome c,
int n)
Functionexecute_object in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not object
public double execute_double(Chromosome c,
int n)
Functionexecute_double in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not doublepublic Type getChildType(int i)
FunctiongetChildType in class Functioncom.groovyj.jgprog.Functioni - the child numberpublic boolean isConstant()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||