|
JGAP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgap.gp.CommandGene
org.jgap.gp.function.ADF
public class ADF
Automatically Defined Function (ADF). Works with output of other chromosomes. An ADF is automatically created by ProgramChromosome. For more information about ADFs see John Koza's book on Genetic Programming. Or google for "Koza ADF". For a German explanation, see see http://www.tu-chemnitz.de/informatik/ThIS/seminare/ws01/gp/singer.pdf or http://www.tu-chemnitz.de/informatik/ThIS/seminare/ws01/gp/forbriger.pdf or http://www.klaus-meffert.de/download/genetische_programmierung_mit_java.pdf
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jgap.gp.CommandGene |
---|
CommandGene.COMMAND_TYPE |
Field Summary |
---|
Fields inherited from class org.jgap.gp.CommandGene |
---|
BooleanClass, CharacterClass, DELTA, DoubleClass, FloatClass, IntegerClass, LongClass, nodeIndex, VoidClass |
Constructor Summary | |
---|---|
ADF(GPConfiguration a_conf,
int a_chromosomeNum,
int a_arity)
Constructor. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object a_other)
The compareTo-method. |
boolean |
equals(java.lang.Object a_other)
The equals-method. |
boolean |
execute_boolean(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as a boolean. |
double |
execute_double(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as a double. |
float |
execute_float(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as a float. |
int |
execute_int(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as an integer. |
java.lang.Object |
execute_object(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as an object. |
int |
getArity(IGPProgram a_individual)
Arity of the command. |
java.lang.Class |
getChildType(IGPProgram a_ind,
int i)
Gets the type of node allowed from the given child number. |
int |
getChromosomeNum()
|
boolean |
isValid(ProgramChromosome a_chrom)
Subclasses capable of validating programs should overwrite this method. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ADF(GPConfiguration a_conf, int a_chromosomeNum, int a_arity) throws InvalidConfigurationException
a_conf
- the configuration to usea_chromosomeNum
- the index of the chromosome to executea_arity
- the arity of the ADF
InvalidConfigurationException
Method Detail |
---|
public int getChromosomeNum()
public java.lang.String toString()
toString
in class CommandGene
public int getArity(IGPProgram a_individual)
CommandGene
getArity
in class CommandGene
a_individual
- the invididual the command's arity may depend on (in
most cases the arity will not depend on the individual)
public int execute_int(ProgramChromosome c, int n, java.lang.Object[] args)
CommandGene
execute_int
in class CommandGene
c
- ignored heren
- ignored hereargs
- ignored here
public boolean execute_boolean(ProgramChromosome c, int n, java.lang.Object[] args)
CommandGene
execute_boolean
in class CommandGene
c
- ignored heren
- ignored hereargs
- ignored here
public float execute_float(ProgramChromosome c, int n, java.lang.Object[] args)
CommandGene
execute_float
in class CommandGene
c
- ignored heren
- ignored hereargs
- ignored here
public double execute_double(ProgramChromosome c, int n, java.lang.Object[] args)
CommandGene
execute_double
in class CommandGene
c
- ignored heren
- ignored hereargs
- ignored here
public java.lang.Object execute_object(ProgramChromosome c, int n, java.lang.Object[] args)
CommandGene
execute_object
in class CommandGene
c
- ignored heren
- ignored hereargs
- ignored here
public java.lang.Class getChildType(IGPProgram a_ind, int i)
CommandGene
getChildType
in class CommandGene
a_ind
- the individual the child belongs toi
- the chromosome number
public boolean isValid(ProgramChromosome a_chrom)
CommandGene
isValid
in class CommandGene
a_chrom
- the ProgramChromosome to validate
public int compareTo(java.lang.Object a_other)
compareTo
in interface java.lang.Comparable
compareTo
in class CommandGene
a_other
- the other object to compare
public boolean equals(java.lang.Object a_other)
equals
in class CommandGene
a_other
- the other object to compare
|
JGAP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |