ec.cgp.problems
Class ProblemRegression

java.lang.Object
  extended by ec.Problem
      extended by ec.cgp.problems.ProblemCGP
          extended by ec.cgp.problems.ProblemRegression
All Implemented Interfaces:
ec.Prototype, ec.Setup, ec.simple.SimpleProblemForm, java.io.Serializable, java.lang.Cloneable

public class ProblemRegression
extends ProblemCGP

Regression problem.

Author:
David Oranchak, doranchak@gmail.com, http://oranchak.com
See Also:
Serialized Form

Field Summary
 int function
          Which function to use.
(package private) static java.lang.String P_WHICH
           
(package private) static float[] testPoints
          50 randomly generated test points used for fitness evaluation
 
Fields inherited from class ec.cgp.problems.ProblemCGP
constantMax, constantMin, constants, numConstants, P_CONSTANT_MAX, P_CONSTANT_MIN, P_CONSTANTS
 
Fields inherited from class ec.Problem
P_PROBLEM
 
Constructor Summary
ProblemRegression()
           
 
Method Summary
 void evaluate(ec.EvolutionState state, ec.Individual ind, int subpopulation, int threadnum)
          Evaluate the CGP and compute fitness
static float function1(float x)
          Sixth-order polynomial.
static float function2(float x)
          Fifth-order polynomial.
static float function3(float x)
          Second-order polynomial.
 void setup(ec.EvolutionState state, ec.util.Parameter base)
          Initialize the evaluation cache, and configure the random constants.
 
Methods inherited from class ec.cgp.problems.ProblemCGP
describe, initConstants
 
Methods inherited from class ec.Problem
canEvaluate, clone, closeContacts, defaultBase, finishEvaluating, initializeContacts, prepareToEvaluate, reinitializeContacts
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

function

public int function
Which function to use. Acceptable values: {1, 2, 3}.


P_WHICH

static java.lang.String P_WHICH

testPoints

static float[] testPoints
50 randomly generated test points used for fitness evaluation

Constructor Detail

ProblemRegression

public ProblemRegression()
Method Detail

evaluate

public void evaluate(ec.EvolutionState state,
                     ec.Individual ind,
                     int subpopulation,
                     int threadnum)
Evaluate the CGP and compute fitness


function1

public static float function1(float x)
Sixth-order polynomial.


function2

public static float function2(float x)
Fifth-order polynomial.


function3

public static float function3(float x)
Second-order polynomial.


setup

public void setup(ec.EvolutionState state,
                  ec.util.Parameter base)
Description copied from class: ProblemCGP
Initialize the evaluation cache, and configure the random constants.

Specified by:
setup in interface ec.Prototype
Specified by:
setup in interface ec.Setup
Overrides:
setup in class ProblemCGP