ec.gp
Class GPTreeConstraints
- java.lang.Object
-
- ec.gp.GPTreeConstraints
-
public class GPTreeConstraints extends java.lang.Object implements Clique
A GPTreeConstraints is a Clique which defines constraint information common to many different GPTree trees, namely the tree type, builder, and function set. GPTreeConstraints have unique names by which they are identified.In adding new things to GPTreeConstraints, you should ask yourself the following questions: first, is this something that takes up too much memory to store in GPTrees themseves? second, is this something that needs to be accessed very rapidly, so cannot be implemented as a method call in a GPTree? third, can this be shared among different GPTrees?
Parameters
base.size
int >= 1(number of tree constraints) base.n.name
String(name of tree constraint n) base.n.init
classname, inherits and != ec.gp.GPNodeBuilder(GP node builder for tree constraint n) base.n.returns
String(tree type for tree constraint n) base.n.fset
String(function set for tree constraint n) - See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description byteconstraintNumberThe byte value of the constraints -- we can only have 256 of themGPFunctionSetfunctionsetThe function set for nodes in the treeGPNodeBuilderinitThe builder for the treejava.lang.Stringnamestatic java.lang.StringP_FUNCTIONSETstatic java.lang.StringP_INITstatic java.lang.StringP_NAMEstatic java.lang.StringP_RETURNSstatic java.lang.StringP_SIZEstatic intSIZE_OF_BYTEGPTypetreetypeThe type of the root of the tree
-
Constructor Summary
Constructors Constructor and Description GPTreeConstraints()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static GPTreeConstraintsconstraintsFor(java.lang.String constraintsName, EvolutionState state)You must guarantee that after calling constraintsFor(...) one or several times, you call state.output.exitIfErrors() once.voidsetup(EvolutionState state, Parameter base)This must be called after the GPTypes and GPFunctionSets have been set up.java.lang.StringtoString()
-
-
-
Field Detail
-
SIZE_OF_BYTE
public static final int SIZE_OF_BYTE
- See Also:
- Constant Field Values
-
P_NAME
public static final java.lang.String P_NAME
- See Also:
- Constant Field Values
-
P_SIZE
public static final java.lang.String P_SIZE
- See Also:
- Constant Field Values
-
P_INIT
public static final java.lang.String P_INIT
- See Also:
- Constant Field Values
-
P_RETURNS
public static final java.lang.String P_RETURNS
- See Also:
- Constant Field Values
-
P_FUNCTIONSET
public static final java.lang.String P_FUNCTIONSET
- See Also:
- Constant Field Values
-
name
public java.lang.String name
-
constraintNumber
public byte constraintNumber
The byte value of the constraints -- we can only have 256 of them
-
init
public GPNodeBuilder init
The builder for the tree
-
treetype
public GPType treetype
The type of the root of the tree
-
functionset
public GPFunctionSet functionset
The function set for nodes in the tree
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setup
public void setup(EvolutionState state, Parameter base)
This must be called after the GPTypes and GPFunctionSets have been set up.
-
constraintsFor
public static GPTreeConstraints constraintsFor(java.lang.String constraintsName, EvolutionState state)
You must guarantee that after calling constraintsFor(...) one or several times, you call state.output.exitIfErrors() once.
-
-
DMelt 3.0 © DataMelt by jWork.ORG