public class PTC1 extends GPNodeBuilder
Luke, Sean. 2000. Issues in Scaling Genetic Programming: Breeding Strategies, Tree Generation, and Code Bloat. Ph.D. Dissertation, Department of Computer Science, University of Maryland, College Park, Maryland.
...and also in
Luke, Sean. 2000. Two fast tree-creation algorithms for genetic programming. In IEEE Transactions on Evolutionary Computation 4:3 (September 2000), 274-283. IEEE.
Both can be found at http://www.cs.gmu.edu/~sean/papers/
PTC1 requires that your function set to implement PTCFunctionSetForm. The provided function set, PTCFunctionSet, does exactly this.
The Strongly-typed PTC1 algorithm is a derivative of the GROW algorithm used in ec.gp.koza.GrowBuilder. The primary differences are:
Parameters
| base.expected-size int >= 1 |
default expected tree size |
| base.max-depth int >= 1 |
maximum allowable tree depth (usually a big value) |
Default Base
gp.build.ptc1
| Modifier and Type | Field and Description |
|---|---|
int |
expectedSize
The default expected tree size for PTC1
|
int |
maxDepth
The largest maximum tree depth PTC1 can specify -- should be big.
|
static String |
P_EXPECTED |
static String |
P_MAXDEPTH |
static String |
P_PTC1 |
CHECK_BOUNDARY, maxSize, minSize, NOSIZEGIVEN, P_MAXSIZE, P_MINSIZE, P_NUMSIZES, P_SIZE, sizeDistribution| Constructor and Description |
|---|
PTC1() |
| Modifier and Type | Method and Description |
|---|---|
Parameter |
defaultBase()
Returns the default base for this prototype.
|
GPNode |
newRootedTree(EvolutionState state,
GPType type,
int thread,
GPNodeParent parent,
GPFunctionSet set,
int argposition,
int requestedSize) |
private GPNode |
ptc1(EvolutionState state,
int current,
GPType type,
int thread,
GPNodeParent parent,
int argposition,
GPFunctionSet set,
PTCFunctionSetForm pset,
double[] nonterminalSelectionProbabilities)
A private function which recursively returns a GROW tree to newRootedTree(...)
|
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.
|
canPick, clone, errorAboutNoNodeWithType, pickSize, warnAboutNonterminal, warnAboutNonTerminalWithType, warnAboutNoTerminalWithTypepublic static final String P_PTC1
public static final String P_EXPECTED
public static final String P_MAXDEPTH
public int maxDepth
public int expectedSize
public Parameter defaultBase()
Prototypepublic 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.
public GPNode newRootedTree(EvolutionState state, GPType type, int thread, GPNodeParent parent, GPFunctionSet set, int argposition, int requestedSize)
newRootedTree in class GPNodeBuilderprivate GPNode ptc1(EvolutionState state, int current, GPType type, int thread, GPNodeParent parent, int argposition, GPFunctionSet set, PTCFunctionSetForm pset, double[] nonterminalSelectionProbabilities)
Copyright © 2014 Evolutionary Computation Laboratory at George Mason University. All rights reserved.