org.vizzini.ai.geneticprogramming.terminal
Class ConstantDoubleTerminal

java.lang.Object
  extended by org.vizzini.util.tree.AbstractTreeNode
      extended by org.vizzini.ai.geneticprogramming.AbstractNode
          extended by org.vizzini.ai.geneticprogramming.terminal.AbstractTerminal
              extended by org.vizzini.ai.geneticprogramming.terminal.ConstantDoubleTerminal
All Implemented Interfaces:
Cloneable, INode, ITerminal, ITreeNode, IVisitable

public class ConstantDoubleTerminal
extends AbstractTerminal

Provides a double ephemeral random constant terminal in genetic programming.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Constructor Summary
ConstantDoubleTerminal(double lowRange, double highRange)
          Construct this object with the given parameter.
 
Method Summary
 INode createNewInstance()
          Create a new instance, using this as an exemplar.
 Object evaluate(IContext context)
          Evaluate this function.
protected  double getHighRange()
           
protected  double getLowRange()
           
 String getName()
           
 Class getReturnType()
          Return the type of the return value.
protected  void reinit()
          Re-initialize.
protected  void setHighRange(double highRange)
           
protected  void setLowRange(double lowRange)
           
protected  void setValue(Double value)
           
 String toString()
          Return a string representation of this object.
 
Methods inherited from class org.vizzini.ai.geneticprogramming.AbstractNode
dotLabel, dotLinkDesc, equals, hashCode, setName
 
Methods inherited from class org.vizzini.util.tree.AbstractTreeNode
acceptBreadthFirst, acceptDepthFirst, add, breadthFirstIterator, children, clone, createTreeNodeCollection, depthFirstIterator, dotDesc, fillCollectionBreadthFirst, fillCollectionChildren, fillCollectionDepthFirst, getBreadthFirstList, getChildAt, getChildCount, getChildren, getDepth, getDepthFirstList, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLevel, getNextSibling, getNodeCount, getParent, getPath, getRoot, getTreeNodeCollectionClass, getUserObject, insert, isChildAllowed, isLeaf, isRoot, remove, remove, removeAllChildren, removeFromParent, setChildAllowed, setChildren, setParent, setTreeNodeCollectionClass, setUserObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.ai.geneticprogramming.INode
setName
 
Methods inherited from interface org.vizzini.util.tree.ITreeNode
add, breadthFirstIterator, children, clone, depthFirstIterator, getBreadthFirstList, getChildAt, getChildCount, getDepth, getDepthFirstList, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLevel, getNextSibling, getNodeCount, getParent, getPath, getRoot, getUserObject, insert, isChildAllowed, isLeaf, isRoot, remove, remove, removeAllChildren, removeFromParent, setChildAllowed, setParent, setUserObject
 
Methods inherited from interface org.vizzini.util.tree.IVisitable
acceptBreadthFirst, acceptDepthFirst
 

Constructor Detail

ConstantDoubleTerminal

public ConstantDoubleTerminal(double lowRange,
                              double highRange)
Construct this object with the given parameter.

Parameters:
lowRange - Low range.
highRange - High range.
Since:
v0.3
Method Detail

createNewInstance

public INode createNewInstance()
Create a new instance, using this as an exemplar.

Specified by:
createNewInstance in interface INode
Overrides:
createNewInstance in class AbstractNode
Since:
v0.3

evaluate

public Object evaluate(IContext context)
Evaluate this function.

Parameters:
context - Context in which to evaluate.
Since:
v0.3

getName

public String getName()
Specified by:
getName in interface INode
Overrides:
getName in class AbstractNode
Returns:
Return name.
Since:
v0.3

getReturnType

public Class getReturnType()
Return the type of the return value.

Since:
v0.3

toString

public String toString()
Return a string representation of this object.

Specified by:
toString in interface ITreeNode
Overrides:
toString in class AbstractTerminal
Since:
v0.3

getHighRange

protected double getHighRange()
Returns:
Return highRange.
Since:
v0.3

getLowRange

protected double getLowRange()
Returns:
Return lowRange.
Since:
v0.3

reinit

protected void reinit()
Re-initialize.

Since:
v0.3

setHighRange

protected void setHighRange(double highRange)
Parameters:
highRange - the highRange to set
Since:
v0.3

setLowRange

protected void setLowRange(double lowRange)
Parameters:
lowRange - the lowRange to set
Since:
v0.3

setValue

protected void setValue(Double value)
Parameters:
value - the value to set
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02