ConstDouble (JEvolution)
Date: 2013-03-21

evSOLve.JEvolution.gp.nodes

## Class ConstDouble

- java.lang.Object
- - evSOLve.JEvolution.gp.ProgramNode
  - - evSOLve.JEvolution.gp.nodes.ConstDouble

- All Implemented Interfaces:
    java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

      public class ConstDouble
      extends ProgramNode

- - ### Field Summary

    - ### Fields inherited from class evSOLve.JEvolution.gp.ProgramNode

      `children, parent, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_INT, TYPE_UNDEFINED, values`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConstDouble(double low, double high)` Constructs the constant within boundaries.
    `ConstDouble(Element n)` Creates the constant via XML.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `eval()` Returns the constant value.
    `int` | `getResultType()` Returns the result type Double.
    `java.lang.String` | `getSignature()` Returns the string signature of the node.
    `void` | `mutate()` Mutates value by a small percentage value drawn from uniform distribution.
    `void` | `randomize()` Assigns a random constant value within boundaries.
    `java.lang.String` | `toString()` Returns the string representation of the node.
    `Element` | `toXml(Element parent)` Saves the constant to XML.

    - ### Methods inherited from class evSOLve.JEvolution.gp.ProgramNode

      `addValue, children, clearValues, clone, create, equals, getAllowsChildren, getChildAt, getChildCount, getIndex, getLevel, getOperandType, getParent, hashCode, insert, isLeaf, remove, remove, removeFromParent, setParent, setUserObject`

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

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ConstDouble

          public ConstDouble(double low,
                     double high)

      Constructs the constant within boundaries.
      Parameters:
        `low` - the lower bound
        `high` - the upper bound

    - #### ConstDouble

          public ConstDouble(Element n)

      Creates the constant via XML.
      Parameters:
        `n` - an XML node element

  - ### Method Detail

    - #### getResultType

          public int getResultType()

      Returns the result type Double.
      Specified by:
        `getResultType` in class `ProgramNode`
      Returns:
        TYPE_DOUBLE

    - #### eval

          public java.lang.Object eval()

      Returns the constant value.
      Specified by:
        `eval` in class `ProgramNode`
      Returns:
        the value as Double

    - #### randomize

          public void randomize()

      Assigns a random constant value within boundaries.
      Overrides:
        `randomize` in class `ProgramNode`

    - #### mutate

          public void mutate()

      Mutates value by a small percentage value drawn from uniform distribution.
      Overrides:
        `mutate` in class `ProgramNode`

    - #### toXml

          public Element toXml(Element parent)

      Saves the constant to XML.
      Overrides:
        `toXml` in class `ProgramNode`
      Parameters:
        `parent` - the JDOM parent element
      Returns:
        the Node element

    - #### getSignature

          public java.lang.String getSignature()

      Returns the string signature of the node.
      Specified by:
        `getSignature` in class `ProgramNode`
      Returns:
        the node's signature

    - #### toString

          public java.lang.String toString()

      Returns the string representation of the node.
      Specified by:
        `toString` in class `ProgramNode`
      Returns:
        the node's string representation