Orbital library

orbital.algorithm.evolutionary
Class ConcurrenceGeneticAlgorithm

java.lang.Object
  extended by orbital.algorithm.evolutionary.GeneticAlgorithm
      extended by orbital.algorithm.evolutionary.IncrementalGeneticAlgorithm
          extended by orbital.algorithm.evolutionary.ConcurrenceGeneticAlgorithm
All Implemented Interfaces:
java.io.Serializable, AlgorithmicTemplate, ProbabilisticAlgorithm

public class ConcurrenceGeneticAlgorithm
extends IncrementalGeneticAlgorithm

This class is a genetic algorithm that weights its members in comparison to the others.

Evaluation will be called with Pairs to weight. Either it returns a Pair of Numbers then, or it is called with both elements again to get their associated weight.

Experimental

Author:
André Platzer
See Also:
Serialized Form
Invariants:
getPopulation() instanceof ComparingPopulation

Nested Class Summary
 
Nested classes/interfaces inherited from class orbital.algorithm.evolutionary.GeneticAlgorithm
GeneticAlgorithm.Configuration
 
Field Summary
static int FLAT_HIERARCHY
          Implemented as flat hierarchy comparison.
static int HIERARCHY
           
static int ROUND_ROBIN
          Implemented as round robin comparison.
 
Constructor Summary
ConcurrenceGeneticAlgorithm()
           
 
Method Summary
 void evolve()
          evolves to the next generation for this population.
 int getConcurrenceComparisons()
          Returns the number of concurrence comparisons required for current population.
 int getConcurrenceType()
           
 boolean isCorrect()
          Whether this algorithm is correct.
 void setConcurrenceType(int type)
          Set the type of concurrence comparison used.
 void setPopulation(Population pop)
          Set the Population for this GeneticAlgorithm.
 java.lang.String toString()
           
 
Methods inherited from class orbital.algorithm.evolutionary.IncrementalGeneticAlgorithm
getPopulationGrowth, replaceGenomes
 
Methods inherited from class orbital.algorithm.evolutionary.GeneticAlgorithm
clone, complexity, equals, getEvaluation, getPopulation, getRandom, getSelection, hashCode, setEvaluation, setRandom, setSelection, solve, spaceComplexity
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ROUND_ROBIN

public static final int ROUND_ROBIN
Implemented as round robin comparison. Round robin comparison: every genome is compared to every other genome. O(n/2*(n-1))

See Also:
Constant Field Values

HIERARCHY

public static final int HIERARCHY
See Also:
Constant Field Values

FLAT_HIERARCHY

public static final int FLAT_HIERARCHY
Implemented as flat hierarchy comparison. Any pairs compete, and then any pairs of winners compete, etc. The loosers of one level all get the same scores. O(n-1)

See Also:
Constant Field Values
Constructor Detail

ConcurrenceGeneticAlgorithm

public ConcurrenceGeneticAlgorithm()
Method Detail

getConcurrenceType

public int getConcurrenceType()

setConcurrenceType

public void setConcurrenceType(int type)
Set the type of concurrence comparison used.

See Also:
FLAT_HIERARCHY, HIERARCHY, ROUND_ROBIN

setPopulation

public void setPopulation(Population pop)
Description copied from class: GeneticAlgorithm
Set the Population for this GeneticAlgorithm.

Overrides:
setPopulation in class GeneticAlgorithm

getConcurrenceComparisons

public int getConcurrenceComparisons()
Returns the number of concurrence comparisons required for current population.

Returns:
the number of concurrence comparisons required evolving each generation of the current population, depending upon the concurrence type.
See Also:
getConcurrenceType()

isCorrect

public boolean isCorrect()
Description copied from interface: ProbabilisticAlgorithm
Whether this algorithm is correct.

Specified by:
isCorrect in interface ProbabilisticAlgorithm
Overrides:
isCorrect in class GeneticAlgorithm
Returns:
whether all solutions found by this algorithms are correct despite the approximative nature of this algorithm. Monte Carlo algorithms are not correct, while Las Vegas algorithms usually are.

evolve

public void evolve()
Description copied from class: GeneticAlgorithm
evolves to the next generation for this population. Parents are selected and will recombine and mutate to produce children genomes who will replace some genomes in this population. This operation is sometimes called breeding.

Overrides:
evolve in class IncrementalGeneticAlgorithm
See Also:
GeneticAlgorithm.selection, Genome.recombine(Gene[],int,double), PopulationImpl.getMaximumRecombination(), PopulationImpl.getMaximumMutation()

toString

public java.lang.String toString()
Overrides:
toString in class GeneticAlgorithm

Orbital library
1.3.0: 11 Apr 2009

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