|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Functions
This interface defines how the Cartesian Genetic Program evaluator calls user-defined functions when they are encountered in the genome. You must provide an implementation of this interface when plugging functions into the CGP evaluations.
Method Summary | |
---|---|
int |
arityOf(int fn)
Return the arity of the given function. |
java.lang.Object |
callFunction(java.lang.Object[] inputs,
int function,
int numFunctions)
Executes the given function with the given inputs. |
java.lang.String |
functionName(int fn)
Return a string representation of the given function name, used when putting together the string representing the entire Cartesian Genetic Program. |
java.lang.String |
inputName(int inp,
java.lang.Object val)
Obtain a string representation of the given input. |
Method Detail |
---|
java.lang.Object callFunction(java.lang.Object[] inputs, int function, int numFunctions)
inputs
- The arguments passed to the function. It is possible that some
or all of the arguments will be unused by some functions.function
- The function number. Every function number must map to a
function.numFunctions
- The total number of functions available.
java.lang.String functionName(int fn)
fn
- The function number
java.lang.String inputName(int inp, java.lang.Object val)
inp
- The input numberval
- Optional input value (needed if you want to display a constant
value for this input)
int arityOf(int fn)
fn
- the function number
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |