JGAP

org.jgap.gp
Class GPProgramBase

java.lang.Object
  extended by org.jgap.gp.GPProgramBase
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, IGPProgram, ICloneable
Direct Known Subclasses:
GPProgram

public abstract class GPProgramBase
extends java.lang.Object
implements IGPProgram

Base class for GPProgram's. See org.jgap.gp.impl.GPProgram for an implementation.

Since:
3.0
See Also:
Serialized Form

Constructor Summary
GPProgramBase()
          Default constructor, only for dynamic instantiation.
GPProgramBase(GPConfiguration a_conf)
           
GPProgramBase(IGPProgram a_prog)
           
 
Method Summary
 double calcFitnessValue()
           
abstract  java.lang.Object clone()
           
 boolean equals(java.lang.Object a_other)
          Compares this entity against the specified object.
 java.lang.Object getApplicationData()
           
 java.lang.Class[] getArgType(int a_index)
           
 java.lang.Class[][] getArgTypes()
           
 double getFitnessValue()
           
 double getFitnessValueDirectly()
           
 GPConfiguration getGPConfiguration()
           
 int[] getMaxDepths()
           
 int getMaxNodes()
           
 int[] getMinDepths()
           
 CommandGene[] getNodeSet(int a_index)
           
 CommandGene[][] getNodeSets()
           
 java.lang.Class getType(int a_index)
           
 java.lang.Class[] getTypes()
           
 void setApplicationData(java.lang.Object a_data)
          Sets the application data object.
 void setArgTypes(java.lang.Class[][] a_argTypes)
           
 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)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jgap.gp.IGPProgram
execute_boolean, execute_double, execute_float, execute_int, execute_object, execute_void, getChromosome, getCommandOfClass, getPersistentRepresentation, setChromosome, size, toStringNorm
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

GPProgramBase

public GPProgramBase()
              throws java.lang.Exception
Default constructor, only for dynamic instantiation.

Throws:
java.lang.Exception
Since:
3.3.4

GPProgramBase

public GPProgramBase(GPConfiguration a_conf)
              throws InvalidConfigurationException
Throws:
InvalidConfigurationException

GPProgramBase

public GPProgramBase(IGPProgram a_prog)
              throws InvalidConfigurationException
Throws:
InvalidConfigurationException
Method Detail

getGPConfiguration

public GPConfiguration getGPConfiguration()
Specified by:
getGPConfiguration in interface IGPProgram

equals

public boolean equals(java.lang.Object a_other)
Compares this entity against the specified object.

Overrides:
equals in class java.lang.Object
Parameters:
a_other - the object to compare against
Returns:
true: if the objects are the same, false otherwise
Since:
3.0

calcFitnessValue

public double calcFitnessValue()
Returns:
fitness value of this program determined via the registered fitness function
Since:
3.0

getFitnessValue

public double getFitnessValue()
Specified by:
getFitnessValue in interface IGPProgram
Returns:
fitness value of this program, cached access
Since:
3.0

getFitnessValueDirectly

public double getFitnessValueDirectly()
Returns:
computed fitness value of this program, may be unitialized
Since:
3.2

setFitnessValue

public void setFitnessValue(double a_fitness)
Specified by:
setFitnessValue in interface IGPProgram

setTypes

public void setTypes(java.lang.Class[] a_types)
Specified by:
setTypes in interface IGPProgram

getTypes

public java.lang.Class[] getTypes()
Specified by:
getTypes in interface IGPProgram

getType

public java.lang.Class getType(int a_index)

setArgTypes

public void setArgTypes(java.lang.Class[][] a_argTypes)
Specified by:
setArgTypes in interface IGPProgram

getArgTypes

public java.lang.Class[][] getArgTypes()
Specified by:
getArgTypes in interface IGPProgram

getArgType

public java.lang.Class[] getArgType(int a_index)

setNodeSets

public void setNodeSets(CommandGene[][] a_nodeSets)
Specified by:
setNodeSets in interface IGPProgram

getNodeSets

public CommandGene[][] getNodeSets()
Specified by:
getNodeSets in interface IGPProgram

getNodeSet

public CommandGene[] getNodeSet(int a_index)

setMaxDepths

public void setMaxDepths(int[] a_maxDepths)
Specified by:
setMaxDepths in interface IGPProgram

getMaxDepths

public int[] getMaxDepths()
Specified by:
getMaxDepths in interface IGPProgram

setMinDepths

public void setMinDepths(int[] a_minDepths)
Specified by:
setMinDepths in interface IGPProgram

getMinDepths

public int[] getMinDepths()
Specified by:
getMinDepths in interface IGPProgram

setMaxNodes

public void setMaxNodes(int a_maxNodes)
Specified by:
setMaxNodes in interface IGPProgram

getMaxNodes

public int getMaxNodes()
Specified by:
getMaxNodes in interface IGPProgram

setApplicationData

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

Specified by:
setApplicationData in interface IGPProgram
Parameters:
a_data - the object to set
Since:
3.01

getApplicationData

public java.lang.Object getApplicationData()
Specified by:
getApplicationData in interface IGPProgram
Returns:
the application data object set
Since:
3.01

clone

public abstract java.lang.Object clone()
Specified by:
clone in interface ICloneable
Overrides:
clone in class java.lang.Object
Returns:
deep clone of this instance
Since:
3.2

JGAP