|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ec.cgp.functions.FunctionsParity
public class FunctionsParity
Function set for the even-n-parity problem.
Field Summary | |
---|---|
(package private) static int |
F_AND
logical and |
(package private) static int |
F_NAND
logical nand |
(package private) static int |
F_NOR
logical nor |
(package private) static int |
F_NOT
logical not |
(package private) static int |
F_OR
logical or |
Constructor Summary | |
---|---|
FunctionsParity()
|
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)
Interpret the given function and apply it to the given inputs. |
java.lang.String |
functionName(int fn)
Return a function name, suitable for display in expressions, for the given function. |
java.lang.String |
inputName(int inp,
java.lang.Object val)
Return the name, suitable for display, for the given input. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static int F_AND
static int F_OR
static int F_NOT
static int F_NOR
static int F_NAND
Constructor Detail |
---|
public FunctionsParity()
Method Detail |
---|
public java.lang.Object callFunction(java.lang.Object[] inputs, int function, int numFunctions)
callFunction
in interface Functions
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.
public java.lang.String functionName(int fn)
functionName
in interface Functions
fn
- The function number
public java.lang.String inputName(int inp, java.lang.Object val)
inputName
in interface Functions
inp
- The input numberval
- Optional input value (needed if you want to display a constant
value for this input)
public int arityOf(int fn)
arityOf
in interface Functions
fn
- the function number
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |