org.jscience.computing.ai.evolutionary.geneticprogramming
Class Terminal

java.lang.Object
  extended by org.jscience.computing.ai.evolutionary.geneticprogramming.Program
      extended by org.jscience.computing.ai.evolutionary.geneticprogramming.Terminal
All Implemented Interfaces:
java.lang.Cloneable

public abstract class Terminal
extends Program

Abstraction for the terminals in genetic programming.


Constructor Summary
Terminal()
           
 
Method Summary
 java.lang.Object clone()
          Returns a deep copy of this Terminal instance
 int countFunctionNodes()
          Returns the number of function nodes this terminal has.
 int countNodes()
          Returns the number of nodes this terminal has.
 int countProgramNodes()
          Returns the number of program nodes this terminal has.
 
Methods inherited from class org.jscience.computing.ai.evolutionary.geneticprogramming.Program
eval, getName, toText
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Terminal

public Terminal()
Method Detail

countNodes

public int countNodes()
Returns the number of nodes this terminal has.

Specified by:
countNodes in class Program
Returns:
1 (each terminal has one node)

countProgramNodes

public int countProgramNodes()
Returns the number of program nodes this terminal has.

Specified by:
countProgramNodes in class Program
Returns:
1 (each terminal has one program)

countFunctionNodes

public int countFunctionNodes()
Returns the number of function nodes this terminal has.

Specified by:
countFunctionNodes in class Program
Returns:
0 (this node is a terminal not a function)

clone

public java.lang.Object clone()
Returns a deep copy of this Terminal instance

Specified by:
clone in class Program
Returns:
deep copy of this terminal