ec.cgp.problems
Class ProblemCGP

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

public abstract class ProblemCGP
extends ec.Problem
implements ec.simple.SimpleProblemForm

A CGP Problem. Provides a single-threaded setup hook that initializes static objects used during evaluation, and provides storage for constants.

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

Field Summary
(package private) static float constantMax
          open upper bound for generated constants
(package private) static float constantMin
          closed lower bound for generated constants
(package private) static float[] constants
          Constants randomly initialized at setup for some problems.
(package private) static int numConstants
          number of constants to use
(package private) static java.lang.String P_CONSTANT_MAX
           
(package private) static java.lang.String P_CONSTANT_MIN
           
(package private) static java.lang.String P_CONSTANTS
           
 
Fields inherited from class ec.Problem
P_PROBLEM
 
Constructor Summary
ProblemCGP()
           
 
Method Summary
 void describe(ec.Individual ind, ec.EvolutionState state, int subpopulation, int threadnum, int log, int verbosity)
          Currently does nothing except enforce the SimpleProblemForm contract.
(package private)  void initConstants(ec.EvolutionState state)
          Initialize the random constants once before this run.
 void setup(ec.EvolutionState state, ec.util.Parameter base)
          Initialize the evaluation cache, and configure the random constants.
 
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
 
Methods inherited from interface ec.simple.SimpleProblemForm
evaluate
 

Field Detail

constants

static float[] constants
Constants randomly initialized at setup for some problems. Once the constants are created, they are kept throughout the run.


numConstants

static int numConstants
number of constants to use


constantMin

static float constantMin
closed lower bound for generated constants


constantMax

static float constantMax
open upper bound for generated constants


P_CONSTANTS

static java.lang.String P_CONSTANTS

P_CONSTANT_MIN

static java.lang.String P_CONSTANT_MIN

P_CONSTANT_MAX

static java.lang.String P_CONSTANT_MAX
Constructor Detail

ProblemCGP

public ProblemCGP()
Method Detail

describe

public void describe(ec.Individual ind,
                     ec.EvolutionState state,
                     int subpopulation,
                     int threadnum,
                     int log,
                     int verbosity)
Currently does nothing except enforce the SimpleProblemForm contract.

Specified by:
describe in interface ec.simple.SimpleProblemForm

setup

public void setup(ec.EvolutionState state,
                  ec.util.Parameter base)
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 ec.Problem

initConstants

void initConstants(ec.EvolutionState state)
Initialize the random constants once before this run. Values are generated uniformly at random within the half-open range [constantMin, constantMax). The same constant values are used throughout this run.