ec.gp
Class GPProblem

java.lang.Object
  extended by ec.Problem
      extended by ec.gp.GPProblem
All Implemented Interfaces:
Prototype, Setup, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Ant, Edge, Lawnmower, Multiplexer, Multiplexer, Parity, Regression, TwoBox

public abstract class GPProblem
extends Problem

A GPProblem is a Problem which is meant to efficiently handle GP evaluation. GPProblems hold one ADFStack, which is used to evaluate a large number of trees without having to be garbage-collected and reallocated. Be sure to call stack.reset() after each tree evaluation.

GPProblem also provides a default (empty) version of describe(...) for SimpleProblemForm so you don't have to bother with it if you don't want to.

Parameters

base.stack
classname, inherits or = ec.ADFStack
(the class for the GPProblem's ADF Stack)
base.data
classname, inherits and != ec.GPData
(the class for the GPProblem's basic GPData type)

Default Base
gp.problem

Parameter bases

base.stack
(stack)
base.data
(data)

Version:
1.0
Author:
Sean Luke
See Also:
Serialized Form

Field Summary
 GPData data
          The GPProblems' GPData
static java.lang.String P_DATA
           
static java.lang.String P_GPPROBLEM
           
static java.lang.String P_STACK
           
 ADFStack stack
          The GPProblem's stack
 
Fields inherited from class ec.Problem
P_PROBLEM
 
Constructor Summary
GPProblem()
           
 
Method Summary
 java.lang.Object clone()
          Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.
 Parameter defaultBase()
          GPProblem defines a default base so your subclass doesn't absolutely have to.
 void describe(Individual ind, EvolutionState state, int subpopulation, int threadnum, int log, int verbosity)
           
 void setup(EvolutionState state, Parameter base)
          Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.
 
Methods inherited from class ec.Problem
canEvaluate, closeContacts, describe, evaluate, evaluate, finishEvaluating, getBase, initializeContacts, prepareToEvaluate, reinitializeContacts, setBase
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_GPPROBLEM

public static final java.lang.String P_GPPROBLEM
See Also:
Constant Field Values

P_STACK

public static final java.lang.String P_STACK
See Also:
Constant Field Values

P_DATA

public static final java.lang.String P_DATA
See Also:
Constant Field Values

stack

public ADFStack stack
The GPProblem's stack


data

public GPData data
The GPProblems' GPData

Constructor Detail

GPProblem

public GPProblem()
Method Detail

defaultBase

public Parameter defaultBase()
GPProblem defines a default base so your subclass doesn't absolutely have to.

Specified by:
defaultBase in interface Prototype
Overrides:
defaultBase in class Problem

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from interface: Prototype
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.

For prototypes, setup(...) is typically called once for the prototype instance; cloned instances do not receive the setup(...) call. setup(...) may be called more than once; the only guarantee is that it will get called at least once on an instance or some "parent" object from which it was ultimately cloned.

Specified by:
setup in interface Prototype
Specified by:
setup in interface Setup
Overrides:
setup in class Problem

clone

public java.lang.Object clone()
Description copied from interface: Prototype
Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.

Typically this should be a full "deep" clone. However, you may share certain elements with other objects rather than clone hem, depending on the situation:

Implementations.

Specified by:
clone in interface Prototype
Overrides:
clone in class Problem

describe

public void describe(Individual ind,
                     EvolutionState state,
                     int subpopulation,
                     int threadnum,
                     int log,
                     int verbosity)
Overrides:
describe in class Problem