geneticWedge.gp
Class Individual

java.lang.Object
  extended by geneticWedge.gp.Individual

public class Individual
extends java.lang.Object

The Individual class represents a single tree (program). A population is usually made up of a large number of Individuals.


Constructor Summary
Individual(IndividualDescriptor.IndividualGrowMethod growMethod, int treeDepth, int minDepth, Function[] functions, Input[] inputs, Constant[] constants)
          Conctructs an Individual from the parameters provided.
Individual(IndividualDescriptor.IndividualGrowMethod growMethod, int treeDepth, int minTreeDepth, Function[] functions, Input[] inputs, Constant[] constants, double growFunctionProportion)
          Constructs an Individual from the parameters provided.
Individual(IndividualDescriptor descriptor)
          Constructs an Individual according to parameters held by the IndividualDescriptor.
Individual(int treeDepth, Function[] functions, Input[] inputs, Constant[] constants, double growFunctionProportion)
          Constructs an Individual from the parameters provided, using the GROW method.
Individual(java.util.Vector<Component> newNodes, Input[] inputs, Constant[] constants)
          Constructs a new Individual containing the Components in newNodes in the specified order.
Individual(java.util.Vector<Component> newNodes, Terminal[] terminals)
          Constructs a new Individual containing the Components in newNodes in the specified order.
 
Method Summary
 Individual clone()
          Creates a clone of this Individual, containing the same components in the same tree structure
 boolean equals(Individual comparison)
          This method will only return true if all of the nodes in the comparison Individual refer to the same Component objects as the reference Individual.
 double getAbsoluteError(double[][] inputs, double[] targetOutputs)
          Returns the Absolute Error for the provided dataset.
 double getAbsoluteError(double[] inputs, double targetOutput)
          Returns the absolute error for the single data-point provided.
 int[] getAllClassificationData(double[][] inputs, double[] targetOutputs, double threshold, boolean useCachedValues, boolean saveValues)
          This returns an array containing 4 values - True Positives, False Positives, True Negatives and False Negatives.
 java.awt.geom.Point2D.Double[] getAllRECCoordinates(double[][] inputs, double[] targetOutputs, AbstractPopulation.FitnessFunction fitnessFunction)
          This method ia used in calculateing AOREC values.
 java.awt.geom.Point2D.Double[] getAllROCCoordinates(double[][] inputs, double[] targetOutputs)
          This method is used in calculating AUROC values.
 java.awt.geom.Point2D.Double[] getAllROCCoordinates(double[] outputs, double[] targetOutputs)
          This method is used in calculating AUROC values.
 double getAOREC(double[][] inputs, double[] targetOutputs, AbstractPopulation.FitnessFunction fitnessFunction)
          Returns the Area over the REC curve (AOREC) during a regression task.
 double getAOREC(double[][] inputs, double[] targetOutputs, AbstractPopulation.FitnessFunction fitnessFunction, boolean useSavedValue)
          Returns the Area over the REC curve (AOREC) during a regression task.
 double getAOREC(double[][] inputs, double[] targetOutputs, int sampleSize, AbstractPopulation.FitnessFunction fitnessFunction)
          Returns the Area over the REC curve (AOREC) during a regression task.
 double getAOREC(double[][] inputs, double[] targetOutputs, int sampleSize, AbstractPopulation.FitnessFunction fitnessFunction, boolean useSavedValue)
          Returns the Area over the REC curve (AOREC) during a regression task.
 double getAUROC(double[][] inputs, double[] targetOutputs)
          Calculates and returns the Area under the ROC curve (AUROC) during a classification task, using all of the provided data.
 double getAUROC(double[][] inputs, double[] targetOutputs, boolean useSavedValue, boolean saveValues)
          Calculates and returns the Area under the ROC curve (AUROC) during a classification task, using all of the provided data.
 double getAUROC(double[][] inputs, double[] targetOutputs, int sampleSize)
          Returns the Area under the ROC curve (AUROC) during a classification task.
 double getAUROC(double[][] inputs, double[] targetOutputs, int sampleSize, boolean useSavedValue, boolean saveValues)
          Returns the Area under the ROC curve (AUROC) during a classification task.
 double getBestROCThreshold(double[][] inputs, double[] targetOutputs)
          This method returns the threshold value that results in the point on the ROC closest to (0,1).
 double getBestROCThreshold(double[][] inputs, double[] targetOutputs, boolean useCachedValue)
          If useCachedValue is true, inputs and targetOutputs will only be used if a cached value is not available.
 double getBestROCThreshold(double[] outputs, double[] targetOutputs)
          This method returns the threshold value that results in the point on the ROC closest to (0,1).
 double getCombinedClassificationError(double[][] inputs, double[] targetOutputs, boolean useSavedValue, boolean useSavedThresholdValue, boolean saveValues)
          This is the sqrt of the sum of the squares of the false negative fraction and the false positive fraction during classification.
 double getCombinedClassificationError(double[][] inputs, double[] targetOutputs, int sampleSize, boolean useSavedValue, boolean useSavedThresholdValue, boolean saveValues)
          This is the sqrt of the sum of the squares of the false negative fraction and the false positive fraction during classification.
 int getDepth()
          Returns the depth of this Individual.
 java.lang.String getExpandedStringFunction()
          Returns the function represented by this Individual, with all terms expanded out and collected.
 double getGrowFunctionProportion()
          Returns the probability of a node selected during growth being a Function (rather than a Terminal).
static Individual getIndividualFromString(java.lang.String string, Function[] functions, Input[] inputs, Constant[] constants)
           
 int getLength()
          Returns the length (number of nodes) in this Individual.
 int getModificationPointFromPoissonDistribution(double lambda, boolean reverseDistribution)
          lambda should be a number between 0.0 and 1.0, i.e.
 int getModificationPointFromPoissonDistribution(double lambda, java.util.Vector<java.lang.Integer> selectedIndices, boolean reverseDistribution)
          lambda should be a number between 0.0 and 1.0, i.e.
 double getMSE(double[][] inputs, double[] targetOutputs)
          Returns the Mean Square Error for the provided dataset.
 double getNegativePredictiveValue(double[][] inputs, double[] targetOutputs)
          Returns the Negative Predictive Value (NPV) during a classification task.
 double getNegativePredictiveValue(double[][] inputs, double[] targetOutputs, double threshold)
          Returns the Negative Predictive Value (NPV) during a classification task.
 java.util.Vector<Component> getNodes()
          Returns the Components within this Individual in the correct order, working from root to leaf and left to right.
 double getNumberCorrectBinary(double[][] inputs, double[] targetOutputs)
          Returns the number of correctly classified outputs from the provided dataset.
 double getNumberCorrectBinary(double[][] inputs, double[] targetOutputs, double threshold)
          Returns the number of correctly classified outputs from the provided dataset.
 double getOutput(double[] input)
          Returns the output of this Individual, given the provided input vector.
 double getPositivePredictiveValue(double[][] inputs, double[] targetOutputs)
          Returns the Positive Predictive Value (PPV) during a classification task.
 double getPositivePredictiveValue(double[][] inputs, double[] targetOutputs, double threshold)
          Returns the Positive Predictive Value (PPV) during a classification task.
 java.awt.geom.Point2D.Double[] getRECCoordinates(double[][] inputs, double[] targetOutputs, int sampleSize, AbstractPopulation.FitnessFunction fitnessFunction)
          This method ia used in calculateing AOREC values.
 double getRMSE(double[][] inputs, double[] targetOutputs)
          Returns the Root Mean Square Error for the provided dataset.
 java.awt.geom.Point2D.Double[] getROCCoordinates(double[][] inputs, double[] targetOutputs, int sampleSize)
          This method is used in calculateing AUROC values.
 double getSensitivity(double[][] inputs, double[] targetOutputs)
          Returns the sensitivity during a classification task.
 double getSensitivity(double[][] inputs, double[] targetOutputs, double threshold)
          Returns the sensitivity during a classification task.
 double getSpecificity(double[][] inputs, double[] targetOutputs)
          Returns the specificity during a classification task.
 double getSpecificity(double[][] inputs, double[] targetOutputs, double threshold)
          Returns the specificity during a classification task.
 double getSquaredError(double[] inputs, double targetOutput)
          Returns the square of the error for the single data-point provided.
 double getThresholdAdjustedOutput(double[] input)
          Returns the threshold adjusted error, i.e.
 void setGrowFunctionProportion(double proportion)
          Sets the probability of a node selected during growth being a Function (rather than a Terminal).
 java.lang.String toString()
          Returns a string representation of this Individual.
 java.lang.String toStringFunction()
          Returns a string representation of this Individual in the format of a mathematical function.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Individual

public Individual(IndividualDescriptor descriptor)
           throws InvalidFractionException
Constructs an Individual according to parameters held by the IndividualDescriptor. These parameters are: maxTreeDepth, minTreeDepth, GrowMethod, functions, constants, inputs, growFunctionProportion

Throws:
InvalidFractionException

Individual

public Individual(IndividualDescriptor.IndividualGrowMethod growMethod,
                  int treeDepth,
                  int minTreeDepth,
                  Function[] functions,
                  Input[] inputs,
                  Constant[] constants,
                  double growFunctionProportion)
           throws InvalidFractionException
Constructs an Individual from the parameters provided.

Throws:
InvalidFractionException

Individual

public Individual(int treeDepth,
                  Function[] functions,
                  Input[] inputs,
                  Constant[] constants,
                  double growFunctionProportion)
           throws InvalidFractionException
Constructs an Individual from the parameters provided, using the GROW method.

Throws:
InvalidFractionException

Individual

public Individual(IndividualDescriptor.IndividualGrowMethod growMethod,
                  int treeDepth,
                  int minDepth,
                  Function[] functions,
                  Input[] inputs,
                  Constant[] constants)
Conctructs an Individual from the parameters provided.

Parameters:
minDepth - This sets the minimum depth of the tree created. It only applies if the GROW method is used; if the FULL method is applied minDepth = treeDepth

Individual

public Individual(java.util.Vector<Component> newNodes,
                  Terminal[] terminals)
Constructs a new Individual containing the Components in newNodes in the specified order. Nodes are added from root to leaf and left to right.

Parameters:
terminals - The terminals should be provided in order to allow the inputs to be changed for different data.

Individual

public Individual(java.util.Vector<Component> newNodes,
                  Input[] inputs,
                  Constant[] constants)
Constructs a new Individual containing the Components in newNodes in the specified order. Nodes are added from root to leaf and left to right.

Parameters:
inputs - The inputs should be provided in order to allow the inputs to be changed for different data.
Method Detail

getIndividualFromString

public static Individual getIndividualFromString(java.lang.String string,
                                                 Function[] functions,
                                                 Input[] inputs,
                                                 Constant[] constants)

clone

public Individual clone()
Creates a clone of this Individual, containing the same components in the same tree structure

Overrides:
clone in class java.lang.Object

getRMSE

public double getRMSE(double[][] inputs,
                      double[] targetOutputs)
               throws InvalidInputSizeException
Returns the Root Mean Square Error for the provided dataset. An exception will be thrown if any data contain the wrong number of inputs

Throws:
InvalidInputSizeException

getMSE

public double getMSE(double[][] inputs,
                     double[] targetOutputs)
              throws InvalidInputSizeException
Returns the Mean Square Error for the provided dataset. An exception will be thrown if any data contain the wrong number of inputs

Throws:
InvalidInputSizeException

getAbsoluteError

public double getAbsoluteError(double[][] inputs,
                               double[] targetOutputs)
                        throws InvalidInputSizeException
Returns the Absolute Error for the provided dataset. An exception will be thrown if any data contain the wrong number of inputs

Throws:
InvalidInputSizeException

getNumberCorrectBinary

public double getNumberCorrectBinary(double[][] inputs,
                                     double[] targetOutputs)
                              throws InvalidInputSizeException
Returns the number of correctly classified outputs from the provided dataset. A classification is considered correct if the predicted output has the same sign as the target output. An exception will be thrown if any data contain the wrong number of inputs

Throws:
InvalidInputSizeException

getNumberCorrectBinary

public double getNumberCorrectBinary(double[][] inputs,
                                     double[] targetOutputs,
                                     double threshold)
                              throws InvalidInputSizeException
Returns the number of correctly classified outputs from the provided dataset. A classification is considered correct if the predicted output exceeds the threshold and the target is positive or if the predicted output is less than or equal to the threshold and the target output is non-positive. An exception will be thrown if any data contain the wrong number of inputs

Throws:
InvalidInputSizeException

getAllClassificationData

public int[] getAllClassificationData(double[][] inputs,
                                      double[] targetOutputs,
                                      double threshold,
                                      boolean useCachedValues,
                                      boolean saveValues)
                               throws InvalidInputSizeException
This returns an array containing 4 values - True Positives, False Positives, True Negatives and False Negatives.

Throws:
InvalidInputSizeException

getSensitivity

public double getSensitivity(double[][] inputs,
                             double[] targetOutputs)
                      throws InvalidInputSizeException
Returns the sensitivity during a classification task. Sensitivity is defined as TP/(TP+FN).

Throws:
InvalidInputSizeException

getSensitivity

public double getSensitivity(double[][] inputs,
                             double[] targetOutputs,
                             double threshold)
                      throws InvalidInputSizeException
Returns the sensitivity during a classification task. Sensitivity is defined as TP/(TP+FN).

Parameters:
threshold - The threshold used during classification. Outputs which exceed the threshold are considered to be 'true'.
Throws:
InvalidInputSizeException

getSpecificity

public double getSpecificity(double[][] inputs,
                             double[] targetOutputs)
                      throws InvalidInputSizeException
Returns the specificity during a classification task. Specificity is defined as TN/(TN+FP).

Throws:
InvalidInputSizeException

getSpecificity

public double getSpecificity(double[][] inputs,
                             double[] targetOutputs,
                             double threshold)
                      throws InvalidInputSizeException
Returns the specificity during a classification task. Specificity is defined as TN/(TN+FP).

Parameters:
threshold - The threshold used during classification. Outputs which exceed the threshold are considered to be 'true'.
Throws:
InvalidInputSizeException

getPositivePredictiveValue

public double getPositivePredictiveValue(double[][] inputs,
                                         double[] targetOutputs)
                                  throws InvalidInputSizeException
Returns the Positive Predictive Value (PPV) during a classification task. PPV is defined as TP/(TP+FP). It may be viewed as the confidence level of a positive prediction.

Throws:
InvalidInputSizeException

getPositivePredictiveValue

public double getPositivePredictiveValue(double[][] inputs,
                                         double[] targetOutputs,
                                         double threshold)
                                  throws InvalidInputSizeException
Returns the Positive Predictive Value (PPV) during a classification task. PPV is defined as TP/(TP+FP). It may be viewed as the confidence level of a positive prediction.

Parameters:
threshold - The threshold used during classification. Outputs which exceed the threshold are considered to be 'true'.
Throws:
InvalidInputSizeException

getNegativePredictiveValue

public double getNegativePredictiveValue(double[][] inputs,
                                         double[] targetOutputs)
                                  throws InvalidInputSizeException
Returns the Negative Predictive Value (NPV) during a classification task. NPV is defined as TN/(TN+FN). It may be viewed as the confidence level of a negative prediction.

Throws:
InvalidInputSizeException

getNegativePredictiveValue

public double getNegativePredictiveValue(double[][] inputs,
                                         double[] targetOutputs,
                                         double threshold)
                                  throws InvalidInputSizeException
Returns the Negative Predictive Value (NPV) during a classification task. NPV is defined as TN/(TN+FN). It may be viewed as the confidence level of a positive prediction.

Parameters:
threshold - The threshold used during classification. Outputs which exceed the threshold are considered to be 'true'.
Throws:
InvalidInputSizeException

getAUROC

public double getAUROC(double[][] inputs,
                       double[] targetOutputs,
                       int sampleSize)
                throws InvalidInputSizeException
Returns the Area under the ROC curve (AUROC) during a classification task. It may be viewed as the confidence level of a positive prediction.

Parameters:
sampleSize - The number of data to be sampled when estimating the AUROC. 100 points is usually enough to give a reasonable estimate.
Throws:
InvalidInputSizeException

getAUROC

public double getAUROC(double[][] inputs,
                       double[] targetOutputs,
                       int sampleSize,
                       boolean useSavedValue,
                       boolean saveValues)
                throws InvalidInputSizeException
Returns the Area under the ROC curve (AUROC) during a classification task. The AUROC is a measure of the discriminatory power of a classifier.

Parameters:
sampleSize - The number of data to be sampled when estimating the AUROC. 100 points is usually enough to give a reasonable estimate.
useSavedValue - If true the AUROC will not be recalculated from the data provided. Instead the last saved value will be returned.
saveValues - This flag indicates that the AUROC value should be saved by this Individual. It may later be returned by calling this method with useSavedValue = true.
Throws:
InvalidInputSizeException

getAUROC

public double getAUROC(double[][] inputs,
                       double[] targetOutputs)
                throws InvalidInputSizeException
Calculates and returns the Area under the ROC curve (AUROC) during a classification task, using all of the provided data. The AUROC is a measure of the discriminatory power of a classifier.

Throws:
InvalidInputSizeException

getAUROC

public double getAUROC(double[][] inputs,
                       double[] targetOutputs,
                       boolean useSavedValue,
                       boolean saveValues)
                throws InvalidInputSizeException
Calculates and returns the Area under the ROC curve (AUROC) during a classification task, using all of the provided data. The AUROC is a measure of the discriminatory power of a classifier.

Parameters:
useSavedValue - If true the AUROC will not be recalculated from the data provided. Instead the last saved value will be returned.
saveValues - This flag indicates that the AUROC value should be saved by this Individual. It may later be returned by calling this method with useSavedValue = true.
Throws:
InvalidInputSizeException

getCombinedClassificationError

public double getCombinedClassificationError(double[][] inputs,
                                             double[] targetOutputs,
                                             int sampleSize,
                                             boolean useSavedValue,
                                             boolean useSavedThresholdValue,
                                             boolean saveValues)
                                      throws InvalidInputSizeException
This is the sqrt of the sum of the squares of the false negative fraction and the false positive fraction during classification. This is the same as the distance between the 'best' point on a ROC curve and (0,1), i.e.the point used to calculate the 'best' thresdhold.

Throws:
InvalidInputSizeException

getCombinedClassificationError

public double getCombinedClassificationError(double[][] inputs,
                                             double[] targetOutputs,
                                             boolean useSavedValue,
                                             boolean useSavedThresholdValue,
                                             boolean saveValues)
                                      throws InvalidInputSizeException
This is the sqrt of the sum of the squares of the false negative fraction and the false positive fraction during classification. This is the same as the distance between the 'best' point on a ROC curve and (0,1), i.e.the point used to calculate the 'best' thresdhold.

Throws:
InvalidInputSizeException

getBestROCThreshold

public double getBestROCThreshold(double[][] inputs,
                                  double[] targetOutputs)
                           throws InvalidInputSizeException
This method returns the threshold value that results in the point on the ROC closest to (0,1).

Throws:
InvalidInputSizeException

getBestROCThreshold

public double getBestROCThreshold(double[] outputs,
                                  double[] targetOutputs)
                           throws InvalidInputSizeException
This method returns the threshold value that results in the point on the ROC closest to (0,1).

Throws:
InvalidInputSizeException

getBestROCThreshold

public double getBestROCThreshold(double[][] inputs,
                                  double[] targetOutputs,
                                  boolean useCachedValue)
                           throws InvalidInputSizeException
If useCachedValue is true, inputs and targetOutputs will only be used if a cached value is not available.

Throws:
InvalidInputSizeException

getAllROCCoordinates

public java.awt.geom.Point2D.Double[] getAllROCCoordinates(double[][] inputs,
                                                           double[] targetOutputs)
                                                    throws InvalidInputSizeException
This method is used in calculating AUROC values. It is a public method to enable other classes to obtain ROC coordinates to be used, for example, in visualisation.

Throws:
InvalidInputSizeException

getAllROCCoordinates

public java.awt.geom.Point2D.Double[] getAllROCCoordinates(double[] outputs,
                                                           double[] targetOutputs)
                                                    throws InvalidInputSizeException
This method is used in calculating AUROC values. It is a public method to enable other classes to obtain ROC coordinates to be used, for example, in visualisation.

Throws:
InvalidInputSizeException

getROCCoordinates

public java.awt.geom.Point2D.Double[] getROCCoordinates(double[][] inputs,
                                                        double[] targetOutputs,
                                                        int sampleSize)
                                                 throws InvalidInputSizeException
This method is used in calculateing AUROC values. It is a public method to enable other classes to obtain ROC coordinates to be used, for example, in visualisation. A random selection of sampleSize points are returned.

Throws:
InvalidInputSizeException

getAOREC

public double getAOREC(double[][] inputs,
                       double[] targetOutputs,
                       int sampleSize,
                       AbstractPopulation.FitnessFunction fitnessFunction)
                throws InvalidInputSizeException
Returns the Area over the REC curve (AOREC) during a regression task. The AOREC is analogous to the AUROC used to select good classifiers.

Parameters:
sampleSize - The number of data to be sampled when estimating the AOREC. 100 points is usually enough to give a reasonable estimate.
Throws:
InvalidInputSizeException

getAOREC

public double getAOREC(double[][] inputs,
                       double[] targetOutputs,
                       int sampleSize,
                       AbstractPopulation.FitnessFunction fitnessFunction,
                       boolean useSavedValue)
                throws InvalidInputSizeException
Returns the Area over the REC curve (AOREC) during a regression task. The AOREC is analogous to the AUROC used to select good classifiers.

Parameters:
sampleSize - The number of data to be sampled when estimating the AOREC. 100 points is usually enough to give a reasonable estimate.
useSavedValue - If true, this method will return the last calculated AOREC value rather than recalculating it.
Throws:
InvalidInputSizeException

getAOREC

public double getAOREC(double[][] inputs,
                       double[] targetOutputs,
                       AbstractPopulation.FitnessFunction fitnessFunction)
                throws InvalidInputSizeException
Returns the Area over the REC curve (AOREC) during a regression task. The AOREC is analogous to the AUROC used to select good classifiers.

Throws:
InvalidInputSizeException

getAOREC

public double getAOREC(double[][] inputs,
                       double[] targetOutputs,
                       AbstractPopulation.FitnessFunction fitnessFunction,
                       boolean useSavedValue)
                throws InvalidInputSizeException
Returns the Area over the REC curve (AOREC) during a regression task. The AOREC is analogous to the AUROC used to select good classifiers.

Parameters:
useSavedValue - If true, this method will return the last calculated AOREC value rather than recalculating it.
Throws:
InvalidInputSizeException

getAllRECCoordinates

public java.awt.geom.Point2D.Double[] getAllRECCoordinates(double[][] inputs,
                                                           double[] targetOutputs,
                                                           AbstractPopulation.FitnessFunction fitnessFunction)
                                                    throws InvalidInputSizeException
This method ia used in calculateing AOREC values. It is a public method to enable other classes to obtain REC coordinates to be used, for example, in visualisation.

Throws:
InvalidInputSizeException

getRECCoordinates

public java.awt.geom.Point2D.Double[] getRECCoordinates(double[][] inputs,
                                                        double[] targetOutputs,
                                                        int sampleSize,
                                                        AbstractPopulation.FitnessFunction fitnessFunction)
                                                 throws InvalidInputSizeException
This method ia used in calculateing AOREC values. It is a public method to enable other classes to obtain REC coordinates to be used, for example, in visualisation. A random selection of sampleSize points are returned.

Throws:
InvalidInputSizeException

getSquaredError

public double getSquaredError(double[] inputs,
                              double targetOutput)
                       throws InvalidInputSizeException
Returns the square of the error for the single data-point provided.

Throws:
InvalidInputSizeException

getAbsoluteError

public double getAbsoluteError(double[] inputs,
                               double targetOutput)
                        throws InvalidInputSizeException
Returns the absolute error for the single data-point provided.

Throws:
InvalidInputSizeException

getThresholdAdjustedOutput

public double getThresholdAdjustedOutput(double[] input)
                                  throws InvalidInputSizeException
Returns the threshold adjusted error, i.e. output-threshold for the single input provided.

Throws:
InvalidInputSizeException

getOutput

public double getOutput(double[] input)
                 throws InvalidInputSizeException
Returns the output of this Individual, given the provided input vector.

Throws:
InvalidInputSizeException

getExpandedStringFunction

public java.lang.String getExpandedStringFunction()
Returns the function represented by this Individual, with all terms expanded out and collected. NOTE: This function is intended to be used with Individuals containing only arithmetic functions


getModificationPointFromPoissonDistribution

public int getModificationPointFromPoissonDistribution(double lambda,
                                                       boolean reverseDistribution)
lambda should be a number between 0.0 and 1.0, i.e. the expected tree depth as a fraction of the Individual's tree depth. If reverseDistribution is false, the distribution will tail off for large values. If true, the distribution will tail off towards zero.


getModificationPointFromPoissonDistribution

public int getModificationPointFromPoissonDistribution(double lambda,
                                                       java.util.Vector<java.lang.Integer> selectedIndices,
                                                       boolean reverseDistribution)
lambda should be a number between 0.0 and 1.0, i.e. the expected tree depth as a fraction of the Individual's tree depth. If reverseDistribution is false, the distribution will tail off for large values. If true, the distribution will tail off towards zero.


getLength

public int getLength()
Returns the length (number of nodes) in this Individual.


getDepth

public int getDepth()
Returns the depth of this Individual.


setGrowFunctionProportion

public void setGrowFunctionProportion(double proportion)
                               throws InvalidFractionException
Sets the probability of a node selected during growth being a Function (rather than a Terminal). This indirectly controls the average tree size.

Throws:
InvalidFractionException

getGrowFunctionProportion

public double getGrowFunctionProportion()
Returns the probability of a node selected during growth being a Function (rather than a Terminal). This parameter indirectly controls the average tree size.


getNodes

public java.util.Vector<Component> getNodes()
Returns the Components within this Individual in the correct order, working from root to leaf and left to right.


toString

public java.lang.String toString()
Returns a string representation of this Individual. All components are separated by commas and components are listed from root to leaf and left to right.

Overrides:
toString in class java.lang.Object

toStringFunction

public java.lang.String toStringFunction()
Returns a string representation of this Individual in the format of a mathematical function. Brackets are used to make operator priority clear (even when they are not required).


equals

public boolean equals(Individual comparison)
This method will only return true if all of the nodes in the comparison Individual refer to the same Component objects as the reference Individual. All Individuals in a Population should therefore be provided with references to the same Component objects.