Class Program

java.lang.Object
org.episteme.core.mathematics.optimization.evolutionary.geneticprogramming.Program
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Function, Terminal

public abstract class Program extends Object implements Cloneable
Abstraction for the programs in genetic programming.
Version:
0.1
Author:
Levent Bayindir
  • Constructor Details

    • Program

      public Program()
  • Method Details

    • toText

      public abstract String toText()
      Returns a string representation of this program. (Instead of toString - Used by Javolution)
      Returns:
      number of function nodes
    • getName

      public abstract String getName()
      Returns the name of this program.
      Returns:
      name of this program
    • eval

      public abstract Object eval(Object fitnessCase)
      Returns evaluation of this program with the given parameter
      Parameters:
      fitnessCase - fitness case to evaluate
      Returns:
      evaluation result
    • countNodes

      public abstract int countNodes()
      Returns the number of nodes this program has.
      Returns:
      number of children nodes
    • countProgramNodes

      public abstract int countProgramNodes()
      Returns the number of program nodes this program has. This method traverses all the children nodes recursively until the leaf nodes are reached and counts the number of programs.
      Returns:
      number of program nodes
    • countFunctionNodes

      public abstract int countFunctionNodes()
      Returns the number of function nodes this program has. This method traverses all the children nodes recursively until the leaf nodes are reached and counts the number of functions.
      Returns:
      number of function nodes
    • clone

      public abstract Object clone()
      Returns a deep copy of this Program instance
      Overrides:
      clone in class Object
      Returns:
      deep copy of this program