org.vizzini.ai.geneticprogramming.function
Class AbstractFunction

java.lang.Object
  extended by org.vizzini.util.tree.AbstractTreeNode
      extended by org.vizzini.ai.geneticprogramming.AbstractNode
          extended by org.vizzini.ai.geneticprogramming.function.AbstractFunction
All Implemented Interfaces:
Cloneable, IFunction, INode, ITreeNode, IVisitable
Direct Known Subclasses:
AbstractArithmeticFunction, AbstractBooleanFunction, AbstractComparisonFunction, AbstractMathematicFunction, AbstractSequenceFunction, If, IfFoodAheadFunction

public abstract class AbstractFunction
extends AbstractNode
implements IFunction

Provides base functionality for a function in genetic programming.

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

Constructor Summary
AbstractFunction()
          Construct this object with the given parameter.
AbstractFunction(String name)
          Construct this object with the given parameter.
 
Method Summary
 void add(ITreeNode treeNode)
          Add the given child.
protected  void checkState()
          Check the current state of this function for legality.
protected  ITreeNodeCollection createTreeNodeCollection()
          Create a new tree node collection of the appropriate type.
static boolean isCheckingState()
           
static void setCheckingState(boolean isCheckingState)
           
 String toString()
          Return a string representation of this object.
 
Methods inherited from class org.vizzini.ai.geneticprogramming.AbstractNode
createNewInstance, dotLabel, dotLinkDesc, equals, getName, hashCode, setName
 
Methods inherited from class org.vizzini.util.tree.AbstractTreeNode
acceptBreadthFirst, acceptDepthFirst, breadthFirstIterator, children, clone, 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.IFunction
getArgCount, getArgType
 
Methods inherited from interface org.vizzini.ai.geneticprogramming.INode
createNewInstance, evaluate, getName, getReturnType, setName
 
Methods inherited from interface org.vizzini.util.tree.ITreeNode
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

AbstractFunction

public AbstractFunction()
Construct this object with the given parameter.

Since:
v0.3

AbstractFunction

public AbstractFunction(String name)
Construct this object with the given parameter.

Parameters:
name - Name.
Since:
v0.3
Method Detail

isCheckingState

public static boolean isCheckingState()
Returns:
Return isCheckingState.

setCheckingState

public static void setCheckingState(boolean isCheckingState)
Parameters:
isCheckingState - the isCheckingState to set

add

public void add(ITreeNode treeNode)
Add the given child.

Specified by:
add in interface ITreeNode
Overrides:
add in class AbstractTreeNode
Since:
v0.3

toString

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

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

checkState

protected void checkState()
Check the current state of this function for legality.

Since:
v0.3

createTreeNodeCollection

protected ITreeNodeCollection createTreeNodeCollection()
Create a new tree node collection of the appropriate type.

Overrides:
createTreeNodeCollection in class AbstractTreeNode
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02