JGAP

examples.gp.symbolicRegression
Class SymbolicRegression

java.lang.Object
  extended by org.jgap.gp.GPProblem
      extended by examples.gp.symbolicRegression.SymbolicRegression

public class SymbolicRegression
extends GPProblem


Nested Class Summary
static class SymbolicRegression.FormulaFitnessFunction
          Fitness function for evaluating the produced fomulas, represented as GP programs.
 
Field Summary
static int adfArity
           
static java.lang.String[] adfFunctions
           
static java.lang.String adfType
           
static boolean bumpPerfect
           
static java.lang.Double bumpValue
           
static java.util.ArrayList<java.lang.Double> constants
           
static double crossoverProb
           
protected static java.lang.Double[][] data
           
static float dynamizeArityProb
           
static long endTime
           
static boolean foundPerfect
           
static double functionProb
           
static java.lang.String[] functions
           
static int[] ignoreVariables
           
static double lowerRange
           
static int maxCrossoverDepth
           
static int maxInitDepth
           
static int maxNodes
           
static int minInitDepth
           
static float mutationProb
           
static double newChromsPercent
           
static int numEvolutions
           
static int numInputVariables
           
static int numRows
           
static java.lang.Integer outputVariable
           
static int populationSize
           
static java.lang.String presentation
           
static int programCreationMaxTries
           
static float reproductionProb
           
static java.lang.String returnType
           
static double scaleError
           
static boolean showPopulation
           
static boolean showSimiliar
           
static long startTime
           
static double stopCriteria
           
static boolean terminalWholeNumbers
           
static int tournamentSelectorSize
           
static double upperRange
           
static boolean useADF
           
static java.lang.String[] variableNames
           
static Variable[] variables
           
static boolean verboseOutput
           
 
Constructor Summary
SymbolicRegression(GPConfiguration a_conf)
           
 
Method Summary
 GPGenotype create()
          This method is used for setting up the commands and terminals that can be used to solve the problem.
static void main(java.lang.String[] args)
          Starts the example.
static void myOutputSolution(IGPProgram a_best, int gen)
          Outputs the best solution until now at standard output.
static void readFile(java.lang.String file)
           
static java.lang.Double[][] transposeMatrix(java.lang.Double[][] m)
           
 
Methods inherited from class org.jgap.gp.GPProblem
createTree, getGPConfiguration, setGPConfiguration, showTree, showTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numInputVariables

public static int numInputVariables

variables

public static Variable[] variables

variableNames

public static java.lang.String[] variableNames

outputVariable

public static java.lang.Integer outputVariable

ignoreVariables

public static int[] ignoreVariables

constants

public static java.util.ArrayList<java.lang.Double> constants

numRows

public static int numRows

data

protected static java.lang.Double[][] data

foundPerfect

public static boolean foundPerfect

minInitDepth

public static int minInitDepth

maxInitDepth

public static int maxInitDepth

populationSize

public static int populationSize

maxCrossoverDepth

public static int maxCrossoverDepth

programCreationMaxTries

public static int programCreationMaxTries

numEvolutions

public static int numEvolutions

verboseOutput

public static boolean verboseOutput

maxNodes

public static int maxNodes

functionProb

public static double functionProb

reproductionProb

public static float reproductionProb

mutationProb

public static float mutationProb

crossoverProb

public static double crossoverProb

dynamizeArityProb

public static float dynamizeArityProb

newChromsPercent

public static double newChromsPercent

tournamentSelectorSize

public static int tournamentSelectorSize

lowerRange

public static double lowerRange

upperRange

public static double upperRange

terminalWholeNumbers

public static boolean terminalWholeNumbers

returnType

public static java.lang.String returnType

presentation

public static java.lang.String presentation

adfArity

public static int adfArity

adfType

public static java.lang.String adfType

useADF

public static boolean useADF

functions

public static java.lang.String[] functions

adfFunctions

public static java.lang.String[] adfFunctions

scaleError

public static double scaleError

bumpPerfect

public static boolean bumpPerfect

bumpValue

public static java.lang.Double bumpValue

startTime

public static long startTime

endTime

public static long endTime

stopCriteria

public static double stopCriteria

showPopulation

public static boolean showPopulation

showSimiliar

public static boolean showSimiliar
Constructor Detail

SymbolicRegression

public SymbolicRegression(GPConfiguration a_conf)
                   throws InvalidConfigurationException
Throws:
InvalidConfigurationException
Method Detail

create

public GPGenotype create()
                  throws InvalidConfigurationException
This method is used for setting up the commands and terminals that can be used to solve the problem.

Specified by:
create in class GPProblem
Returns:
GPGenotype
Throws:
InvalidConfigurationException

readFile

public static void readFile(java.lang.String file)

transposeMatrix

public static java.lang.Double[][] transposeMatrix(java.lang.Double[][] m)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Starts the example.

Throws:
java.lang.Exception

myOutputSolution

public static void myOutputSolution(IGPProgram a_best,
                                    int gen)
Outputs the best solution until now at standard output. This is stolen (and somewhat edited) from GPGenotype.outputSolution which used log4j.

Parameters:
a_best - the fittest ProgramChromosome

JGAP