|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectec.Problem
ec.gp.GPProblem
public abstract class GPProblem
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) |
| 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 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, finishEvaluating, initializeContacts, prepareToEvaluate, reinitializeContacts |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String P_GPPROBLEM
public static final java.lang.String P_STACK
public static final java.lang.String P_DATA
public ADFStack stack
public GPData data
| Constructor Detail |
|---|
public GPProblem()
| Method Detail |
|---|
public Parameter defaultBase()
defaultBase in interface PrototypedefaultBase in class Problem
public void setup(EvolutionState state,
Parameter base)
PrototypeFor 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.
setup in interface Prototypesetup in interface Setupsetup in class Problempublic java.lang.Object clone()
PrototypeTypically 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.
public Object clone()
{
try
{
return super.clone();
}
catch ((CloneNotSupportedException e)
{ throw new InternalError(); } // never happens
}
public Object clone()
{
try
{
MyObject myobj = (MyObject) (super.clone());
// put your deep-cloning code here...
}
catch ((CloneNotSupportedException e)
{ throw new InternalError(); } // never happens
return myobj;
}
public Object clone()
{
MyObject myobj = (MyObject) (super.clone());
// put your deep-cloning code here...
return myobj;
}
clone in interface Prototypeclone in class Problem
public void describe(Individual ind,
EvolutionState state,
int threadnum,
int log,
int verbosity)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||