public class GPNodeConstraints extends java.lang.Object implements Clique
In adding new things to GPNodeConstraints, you should ask yourself the following questions: first, is this something that takes up too much memory to store in GPNodes themselves? second, is this something that needs to be accessed very rapidly, so cannot be implemented as a method call in a GPNode? third, can this be shared among different GPNodes, even ones representing different functions?
Parameters
base.size int >= 1 |
(number of node constraints) |
base.n.name String |
(name of node constraint n) |
base.n.returns String |
(return type for node constraint n) |
base.n.size int >= 1 |
(number of child arguments for node constraint n) |
base.n.child.m String |
(name of type for child argument m of node constraint n) |
base.prob double >= 0.0 |
(auxillary probability of selection -- used by ec.gp.build.PTC1 and ec.gp.build.PTC2) |
Modifier and Type | Field and Description |
---|---|
GPType[] |
childtypes
The children types for a GPNode
|
byte |
constraintNumber
The byte value of the constraints -- we can only have 256 of them
|
static double |
DEFAULT_PROBABILITY |
java.lang.String |
name
The name of the GPNodeConstraints object -- this is NOT the
name of the GPNode
|
static java.lang.String |
P_CHILD |
static java.lang.String |
P_NAME |
static java.lang.String |
P_PROBABILITY |
static java.lang.String |
P_RETURNS |
static java.lang.String |
P_SIZE |
double |
probabilityOfSelection
Probability of selection -- an auxillary measure mostly used by PTC1/PTC2
right now
|
GPType |
returntype
The return type for a GPNode
|
static int |
SIZE_OF_BYTE |
GPNode[] |
zeroChildren
A little memory optimization: if GPNodes have no children, they are welcome to
use share this zero-sized array as their children array.
|
Constructor and Description |
---|
GPNodeConstraints() |
Modifier and Type | Method and Description |
---|---|
static GPNodeConstraints |
constraintsFor(java.lang.String constraintsName,
EvolutionState state)
You must guarantee that after calling constraintsFor(...) one or
several times, you call state.output.exitIfErrors() once.
|
void |
setup(EvolutionState state,
Parameter base)
This must be called after the GPTypes have been set up.
|
java.lang.String |
toString() |
public static final int SIZE_OF_BYTE
public static final java.lang.String P_NAME
public static final java.lang.String P_RETURNS
public static final java.lang.String P_CHILD
public static final java.lang.String P_SIZE
public static final java.lang.String P_PROBABILITY
public static final double DEFAULT_PROBABILITY
public double probabilityOfSelection
public byte constraintNumber
public GPType returntype
public GPType[] childtypes
public java.lang.String name
public GPNode[] zeroChildren
public java.lang.String toString()
toString
in class java.lang.Object
public void setup(EvolutionState state, Parameter base)
public static GPNodeConstraints constraintsFor(java.lang.String constraintsName, EvolutionState state)