Package ec.gp

# Class GPNodeConstraints

java.lang.Object
ec.gp.GPNodeConstraints

All Implemented Interfaces:
  `Clique`, `Setup`, `Serializable`

public class GPNodeConstraints extends Object implements Clique
A GPNodeConstraints is a Clique which defines constraint information common to many different GPNode functions, namely return types, child types, and number of children. GPNodeConstraints have unique names by which they are identified.

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)

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  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 final double`
  `DEFAULT_PROBABILITY`
  `String`
  `name`
  The name of the GPNodeConstraints object -- this is NOT the name of the GPNode
  `static final String`
  `P_CHILD`
  `static final String`
  `P_NAME`
  `static final String`
  `P_PROBABILITY`
  `static final String`
  `P_RETURNS`
  `static final 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 final 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 Summary

  Constructors
  Constructor
  Description
  `GPNodeConstraints()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static GPNodeConstraints`
  `constraintsFor(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.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### SIZE_OF_BYTE

    public static final int SIZE_OF_BYTE
    See Also:
      - Constant Field Values

  - ### P_NAME

    public static final String P_NAME
    See Also:
      - Constant Field Values

  - ### P_RETURNS

    public static final String P_RETURNS
    See Also:
      - Constant Field Values

  - ### P_CHILD

    public static final String P_CHILD
    See Also:
      - Constant Field Values

  - ### P_SIZE

    public static final String P_SIZE
    See Also:
      - Constant Field Values

  - ### P_PROBABILITY

    public static final String P_PROBABILITY
    See Also:
      - Constant Field Values

  - ### DEFAULT_PROBABILITY

    public static final double DEFAULT_PROBABILITY
    See Also:
      - Constant Field Values

  - ### probabilityOfSelection

    public double probabilityOfSelection
    Probability of selection -- an auxillary measure mostly used by PTC1/PTC2 right now

  - ### constraintNumber

    public byte constraintNumber
    The byte value of the constraints -- we can only have 256 of them

  - ### returntype

    public GPType returntype
    The return type for a GPNode

  - ### childtypes

    public GPType[] childtypes
    The children types for a GPNode

  - ### name

    public String name
    The name of the GPNodeConstraints object -- this is NOT the name of the GPNode

  - ### zeroChildren

    public 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 Details

  - ### GPNodeConstraints

    public GPNodeConstraints()

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### setup

    public void setup(EvolutionState state, Parameter base)
    This must be called after the GPTypes have been set up.
    Specified by:
      `setup` in interface `Setup`

  - ### constraintsFor

    public static GPNodeConstraints constraintsFor(String constraintsName, EvolutionState state)
    You must guarantee that after calling constraintsFor(...) one or several times, you call state.output.exitIfErrors() once.