JGAP

org.jgap.gp
Class GPProblem

java.lang.Object
  extended by org.jgap.gp.GPProblem
Direct Known Subclasses:
AntTrailProblem, ClientEvolveStrategy, DrawingProblem, Fibonacci, KarubProblem, MathProblem, PaintedDesertProblem, SimpleExample, SymbolicRegression, TicTacToeMain

public abstract class GPProblem
extends java.lang.Object

Abstract base class for all GP problems. See packages examples.gp and examples.grid for sample implementations.

Since:
3.0

Constructor Summary
GPProblem()
          Default constructor for dynamic instantiation.
GPProblem(GPConfiguration a_conf)
           
 
Method Summary
abstract  GPGenotype create()
           
 javax.swing.tree.TreeNode createTree(IGPProgram a_prog)
          Creates a tree out of a given GP program.
 GPConfiguration getGPConfiguration()
           
protected  void setGPConfiguration(GPConfiguration a_conf)
          Sets the configuration.
 void showTree(IGPProgram a_prog, java.lang.String a_filename)
          Creates a graphical tree out of a given GP program and saves it to a file.
 void showTree(IGPProgram a_prog, java.lang.String a_filename, org.jgap.util.tree.TreeBranchRenderer a_treeBranchRenderer, org.jgap.util.tree.TreeNodeRenderer a_treeNodeRenderer)
          Creates a tree out of a given GP program and saves it to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GPProblem

public GPProblem(GPConfiguration a_conf)
          throws InvalidConfigurationException
Throws:
InvalidConfigurationException

GPProblem

public GPProblem()
Default constructor for dynamic instantiation.

Since:
3.2
Method Detail

create

public abstract GPGenotype create()
                           throws InvalidConfigurationException
Returns:
newly created GPGenotype
Throws:
InvalidConfigurationException
Since:
3.0

showTree

public void showTree(IGPProgram a_prog,
                     java.lang.String a_filename)
              throws InvalidConfigurationException
Creates a graphical tree out of a given GP program and saves it to a file.

Parameters:
a_prog - the GP program to visualize a tree for
a_filename - the name of the file to save the tree in
Throws:
InvalidConfigurationException
Since:
3.0

showTree

public void showTree(IGPProgram a_prog,
                     java.lang.String a_filename,
                     org.jgap.util.tree.TreeBranchRenderer a_treeBranchRenderer,
                     org.jgap.util.tree.TreeNodeRenderer a_treeNodeRenderer)
              throws InvalidConfigurationException
Creates a tree out of a given GP program and saves it to a file. Allows to preset the tree renderers.

Parameters:
a_prog - the GP program to visualize a tree for
a_filename - the name of the file to save the tree in
a_treeBranchRenderer - renderer for the tree's branches
a_treeNodeRenderer - renderer for the tree's nodes
Throws:
InvalidConfigurationException
Since:
3.0

createTree

public javax.swing.tree.TreeNode createTree(IGPProgram a_prog)
                                     throws InvalidConfigurationException
Creates a tree out of a given GP program.

Parameters:
a_prog - the GPGenotype to visualize a tree for
Returns:
the TreeNode object corresponding to the GP program
Throws:
InvalidConfigurationException
Since:
3.0

getGPConfiguration

public GPConfiguration getGPConfiguration()
Returns:
the GPConfiguration set
Since:
3.0

setGPConfiguration

protected void setGPConfiguration(GPConfiguration a_conf)
Sets the configuration. Only use in case of dynamic instantiation (in case constructor with parameter GPConfiguration is not used).

Parameters:
a_conf - the configuration to set
Since:
3.2

JGAP