JGAP

org.jgap.gp
Interface IGPProgram

All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable, ICloneable, java.io.Serializable
All Known Implementing Classes:
GPProgram, GPProgramBase

public interface IGPProgram
extends java.io.Serializable, java.lang.Comparable, ICloneable

Interface for GP programs.

Since:
3.0

Field Summary
static java.lang.String CVS_REVISION
          String containing the CVS revision.
 
Method Summary
 boolean execute_boolean(int a_chromosomeNum, java.lang.Object[] a_args)
          Executes the given chromosome as a boolean function.
 double execute_double(int a_chromosomeNum, java.lang.Object[] a_args)
          Executes the given chromosome as a double function.
 float execute_float(int a_chromosomeNum, java.lang.Object[] a_args)
          Executes the given chromosome as a float function.
 int execute_int(int a_chromosomeNum, java.lang.Object[] a_args)
          Executes the given chromosome as an integer function.
 java.lang.Object execute_object(int a_chromosomeNum, java.lang.Object[] a_args)
          Executes the given chromosome as an object function.
 void execute_void(int a_chromosomeNum, java.lang.Object[] a_args)
          Executes the given chromosome as an object function.
 java.lang.Object getApplicationData()
           
 java.lang.Class[][] getArgTypes()
           
 ProgramChromosome getChromosome(int a_index)
           
 int getCommandOfClass(int a_chromosomeNum, java.lang.Class a_class)
          Searches for a chromosome that has the given class and returns its index.
 double getFitnessValue()
           
 GPConfiguration getGPConfiguration()
           
 int[] getMaxDepths()
           
 int getMaxNodes()
           
 int[] getMinDepths()
           
 CommandGene[][] getNodeSets()
           
 java.lang.String getPersistentRepresentation()
           
 java.lang.Class[] getTypes()
           
 void setApplicationData(java.lang.Object a_data)
          Sets the application data object.
 void setArgTypes(java.lang.Class[][] a_argTypes)
           
 void setChromosome(int a_index, ProgramChromosome a_chrom)
          Sets the given chromosome at the given index.
 void setFitnessValue(double a_fitness)
           
 void setMaxDepths(int[] a_maxDepths)
           
 void setMaxNodes(int a_maxNodes)
           
 void setMinDepths(int[] a_minDepths)
           
 void setNodeSets(CommandGene[][] a_nodeSets)
           
 void setTypes(java.lang.Class[] a_types)
           
 int size()
           
 java.lang.String toStringNorm(int a_startNode)
          Builds a string that represents the normalized output of the GP program.
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.jgap.util.ICloneable
clone
 

Field Detail

CVS_REVISION

static final java.lang.String CVS_REVISION
String containing the CVS revision. Read out via reflection!

See Also:
Constant Field Values
Method Detail

execute_int

int execute_int(int a_chromosomeNum,
                java.lang.Object[] a_args)
Executes the given chromosome as an integer function.

Parameters:
a_chromosomeNum - the index of the chromosome to execute
a_args - the arguments to use
Returns:
the integer return value
Since:
3.0

execute_float

float execute_float(int a_chromosomeNum,
                    java.lang.Object[] a_args)
Executes the given chromosome as a float function.

Parameters:
a_chromosomeNum - the index of the chromosome to execute
a_args - the arguments to use
Returns:
the floar return value
Since:
3.0

execute_double

double execute_double(int a_chromosomeNum,
                      java.lang.Object[] a_args)
Executes the given chromosome as a double function.

Parameters:
a_chromosomeNum - the index of the chromosome to execute
a_args - the arguments to use
Returns:
the double return value
Since:
3.0

execute_boolean

boolean execute_boolean(int a_chromosomeNum,
                        java.lang.Object[] a_args)
Executes the given chromosome as a boolean function.

Parameters:
a_chromosomeNum - the index of the chromosome to execute
a_args - the arguments to use
Returns:
the boolean return value
Since:
3.2

execute_object

java.lang.Object execute_object(int a_chromosomeNum,
                                java.lang.Object[] a_args)
Executes the given chromosome as an object function.

Parameters:
a_chromosomeNum - the index of the chromosome to execute
a_args - the arguments to use
Returns:
the object return value
Since:
3.0

execute_void

void execute_void(int a_chromosomeNum,
                  java.lang.Object[] a_args)
Executes the given chromosome as an object function.

Parameters:
a_chromosomeNum - the index of the chromosome to execute
a_args - the arguments to use
Since:
3.0

size

int size()
Returns:
the number of chromosomes in the program
Since:
3.0

getChromosome

ProgramChromosome getChromosome(int a_index)
Parameters:
a_index - the chromosome to get
Returns:
the ProgramChromosome with the given index
Since:
3.0

getFitnessValue

double getFitnessValue()
Returns:
fitness value of this program
Since:
3.0

toStringNorm

java.lang.String toStringNorm(int a_startNode)
Builds a string that represents the normalized output of the GP program.

Parameters:
a_startNode - the node to start with
Returns:
textual output in normalized notion
Since:
3.0

setChromosome

void setChromosome(int a_index,
                   ProgramChromosome a_chrom)
Sets the given chromosome at the given index.

Parameters:
a_index - the index to the the chromosome at
a_chrom - the chromosome to set
Since:
3.0

getCommandOfClass

int getCommandOfClass(int a_chromosomeNum,
                      java.lang.Class a_class)
Searches for a chromosome that has the given class and returns its index.

Parameters:
a_chromosomeNum - the index of the chromosome to start the search with
a_class - the class to find
Returns:
the index of the first chromosome found that is of a_class, or -1
Since:
3.0

setFitnessValue

void setFitnessValue(double a_fitness)

setTypes

void setTypes(java.lang.Class[] a_types)

getTypes

java.lang.Class[] getTypes()

setArgTypes

void setArgTypes(java.lang.Class[][] a_argTypes)

getArgTypes

java.lang.Class[][] getArgTypes()

setNodeSets

void setNodeSets(CommandGene[][] a_nodeSets)

getNodeSets

CommandGene[][] getNodeSets()

setMaxDepths

void setMaxDepths(int[] a_maxDepths)

getMaxDepths

int[] getMaxDepths()

setMinDepths

void setMinDepths(int[] a_minDepths)

getMinDepths

int[] getMinDepths()

setMaxNodes

void setMaxNodes(int a_maxNodes)

getMaxNodes

int getMaxNodes()

getGPConfiguration

GPConfiguration getGPConfiguration()

setApplicationData

void setApplicationData(java.lang.Object a_data)
Sets the application data object.

Parameters:
a_data - the object to set
Since:
3.01

getApplicationData

java.lang.Object getApplicationData()
Returns:
the application data object set
Since:
3.01

getPersistentRepresentation

java.lang.String getPersistentRepresentation()
Returns:
the persistent representation of the population, including all GP programs
Since:
3.3

JGAP