Orbital library

orbital.algorithm.evolutionary
Class GeneticAlgorithm.Configuration

java.lang.Object
  extended by orbital.algorithm.template.AlgorithmicTemplate.Configuration
      extended by orbital.algorithm.evolutionary.GeneticAlgorithm.Configuration
All Implemented Interfaces:
java.io.Serializable, AlgorithmicConfiguration
Enclosing class:
GeneticAlgorithm

public static class GeneticAlgorithm.Configuration
extends AlgorithmicTemplate.Configuration

Algorithmic configuration objects for genetic algorithms.

Author:
André Platzer
See Also:
Serialized Form

Constructor Summary
GeneticAlgorithm.Configuration(GeneticAlgorithmProblem problem, Function selector, java.lang.Class algorithm)
           
GeneticAlgorithm.Configuration(GeneticAlgorithmProblem problem, Function selector, double maximumRecombination, double maximumMutation, java.lang.Class algorithm)
           
GeneticAlgorithm.Configuration(GeneticAlgorithmProblem problem, Function selector, int parentCount, int childrenCount, double maximumRecombination, double maximumMutation, java.lang.Class algorithm)
          Construct a new configuration.
 
Method Summary
 AlgorithmicTemplate getAlgorithm()
          Gets the algorithm used for solving the problem.
 int getChildrenCount()
          Get the number of children produced with one reproduction involving parentCount parents.
 double getMaximumMutation()
          Get the maximum probability rating of mutation level for reproduction.
 double getMaximumRecombination()
          Get the maximum probability rating of recombining parental genomes per production.
 int getParentCount()
          Get the number of abstract parents required to produce children.
 AlgorithmicProblem getProblem()
          Get a modified view of the problem.
 Function getSelection()
          Get the selection scheme to apply while evolving.
 void setChildrenCount(int n)
          Set the number of children produced with one reproduction involving parentCount parents.
 void setMaximumMutation(double mutation)
          Set the maximum probability rating of mutation level for reproduction.
 void setMaximumRecombination(double recombination)
          Set the maximum probability rating of recombining parental genomes per production.
 void setParentCount(int n)
          Set the number of abstract parents required to produce children.
 java.lang.Object solve()
          Solves the problem with the algorithm with regard to the additional parameters managed by this algorithmic configuration.
 
Methods inherited from class orbital.algorithm.template.AlgorithmicTemplate.Configuration
flexible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneticAlgorithm.Configuration

public GeneticAlgorithm.Configuration(GeneticAlgorithmProblem problem,
                                      Function selector,
                                      int parentCount,
                                      int childrenCount,
                                      double maximumRecombination,
                                      double maximumMutation,
                                      java.lang.Class algorithm)
Construct a new configuration.

Parameters:
problem - the problem to solve.
selector - the selection function Population→Genome for selecting parents.
parentCount - The number of abstract parents required to produce children.
childrenCount - The number of children produced with one reproduction involving parentCount parents.
maximumRecombination - Maximum recombination rating. Maximum probability rating of recombining parental genomes per production.
maximumMutation - Maximum mutation rating. Maximum probability rating of mutation level for reproduction.
algorithm - the class of the AlgorithmicTemplate to instantiate for solving the problem.
See Also:
Selectors

GeneticAlgorithm.Configuration

public GeneticAlgorithm.Configuration(GeneticAlgorithmProblem problem,
                                      Function selector,
                                      double maximumRecombination,
                                      double maximumMutation,
                                      java.lang.Class algorithm)

GeneticAlgorithm.Configuration

public GeneticAlgorithm.Configuration(GeneticAlgorithmProblem problem,
                                      Function selector,
                                      java.lang.Class algorithm)
Method Detail

getSelection

public Function getSelection()
Get the selection scheme to apply while evolving.

See Also:
Selectors

getParentCount

public int getParentCount()
Get the number of abstract parents required to produce children.


setParentCount

public void setParentCount(int n)
Set the number of abstract parents required to produce children.

Preconditions:
n > 0

getChildrenCount

public int getChildrenCount()
Get the number of children produced with one reproduction involving parentCount parents.


setChildrenCount

public void setChildrenCount(int n)
Set the number of children produced with one reproduction involving parentCount parents.

Preconditions:
n >= 0

getMaximumRecombination

public double getMaximumRecombination()
Get the maximum probability rating of recombining parental genomes per production.


setMaximumRecombination

public void setMaximumRecombination(double recombination)
Set the maximum probability rating of recombining parental genomes per production.

Preconditions:
recombination∈[0,1] is a probability

getMaximumMutation

public double getMaximumMutation()
Get the maximum probability rating of mutation level for reproduction.


setMaximumMutation

public void setMaximumMutation(double mutation)
Set the maximum probability rating of mutation level for reproduction.

Preconditions:
mutation∈[0,1] is a probability

getProblem

public AlgorithmicProblem getProblem()
Get a modified view of the problem. Modifies the problem by letting its GeneticAlgorithmProblem.getPopulation() return a PopulationImpl with all properties set according to this configuration.

Specified by:
getProblem in interface AlgorithmicConfiguration
Overrides:
getProblem in class AlgorithmicTemplate.Configuration

getAlgorithm

public AlgorithmicTemplate getAlgorithm()
Description copied from interface: AlgorithmicConfiguration
Gets the algorithm used for solving the problem.

Specified by:
getAlgorithm in interface AlgorithmicConfiguration
Overrides:
getAlgorithm in class AlgorithmicTemplate.Configuration
Returns:
the algorithm, with our additional parameters already adjusted.

solve

public java.lang.Object solve()
Description copied from interface: AlgorithmicConfiguration
Solves the problem with the algorithm with regard to the additional parameters managed by this algorithmic configuration.

Specified by:
solve in interface AlgorithmicConfiguration
Overrides:
solve in class AlgorithmicTemplate.Configuration
Returns:
the solution to the problem AlgorithmicConfiguration.getProblem() by using the algorithm AlgorithmicConfiguration.getAlgorithm() after adjusting our additional parameters.
See Also:
Convenience method

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.