org.dllearner.algorithms.gp
Class GPUtilities

java.lang.Object
  extended by org.dllearner.algorithms.gp.GPUtilities

public class GPUtilities
extends Object

A utility class, which implements crossover, mutation and tree creation methods. Schwaechen: Der Code ist ziemlich komplex und die Performance nicht besonders gut, da oefter Baeume komplett neu erstellt statt geklont werden etc. Wenn der Code erstmal lauffaehig ist, dann kann man hier noch mit Optimierungen ansetzen. Notiz: Wenn man den einzelnen Knoten noch eine Stelligkeit zuweist, dann koennte man diese Klasse komplett generisch halten, d.h. unabhaengig davon, dass DLs gelernt werden sollen.

Author:
Jens Lehmann

Field Summary
static int crossover
           
static int fitnessEvaluations
           
static int hillClimbing
           
static int mutation
           
 
Constructor Summary
GPUtilities()
           
 
Method Summary
static boolean checkProgram(Program prog)
           
static void checkPrograms(Program[] progs)
           
static boolean checkTree(Description node, boolean isRootNode)
           
static Program createFullRandomProgram(AbstractLearningProblem learningProblem, AbstractReasonerComponent rs, int depth, boolean adc)
          Create a program using the full method.
static Program createGrowRandomProgram(AbstractLearningProblem learningProblem, AbstractReasonerComponent rs, int depth, boolean adc)
          Create a program using the grow method.
static Description createGrowRandomTree(AbstractLearningProblem learningProblem, AbstractReasonerComponent rs, int depth, boolean useADC)
           
static Program createProgram(AbstractLearningProblem learningProblem, Description mainTree)
           
static Program[] crossover(AbstractLearningProblem learningProblem, Program p1, Program p2)
          Perform crossover on two programs.
static Program hillClimbing(AbstractLearningProblem learningProblem, AbstractReasonerComponent rs, Program p)
           
static Program mutation(AbstractLearningProblem learningProblem, AbstractReasonerComponent rs, Program p)
          Perform a point mutation on the given program.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fitnessEvaluations

public static int fitnessEvaluations

crossover

public static int crossover

mutation

public static int mutation

hillClimbing

public static int hillClimbing
Constructor Detail

GPUtilities

public GPUtilities()
Method Detail

createProgram

public static Program createProgram(AbstractLearningProblem learningProblem,
                                    Description mainTree)

mutation

public static Program mutation(AbstractLearningProblem learningProblem,
                               AbstractReasonerComponent rs,
                               Program p)
Perform a point mutation on the given program.

Parameters:
p - The program to be mutated.

crossover

public static Program[] crossover(AbstractLearningProblem learningProblem,
                                  Program p1,
                                  Program p2)
Perform crossover on two programs.

Parameters:
p1 - First parent.
p2 - Second parent.
Returns:
A two-element array containing the offpsring.

hillClimbing

public static Program hillClimbing(AbstractLearningProblem learningProblem,
                                   AbstractReasonerComponent rs,
                                   Program p)

createFullRandomProgram

public static Program createFullRandomProgram(AbstractLearningProblem learningProblem,
                                              AbstractReasonerComponent rs,
                                              int depth,
                                              boolean adc)
Create a program using the full method.

Parameters:
depth - Depth of the tree.
Returns:
The created program.

createGrowRandomProgram

public static Program createGrowRandomProgram(AbstractLearningProblem learningProblem,
                                              AbstractReasonerComponent rs,
                                              int depth,
                                              boolean adc)
Create a program using the grow method.

Parameters:
depth - The maximum depth of the program tree.
Returns:
The created program.

createGrowRandomTree

public static Description createGrowRandomTree(AbstractLearningProblem learningProblem,
                                               AbstractReasonerComponent rs,
                                               int depth,
                                               boolean useADC)

checkPrograms

public static void checkPrograms(Program[] progs)

checkProgram

public static boolean checkProgram(Program prog)

checkTree

public static boolean checkTree(Description node,
                                boolean isRootNode)


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann