Watchmaker Framework API
(Version 0.6.2)

org.uncommons.watchmaker.framework
Class ConcurrentEvolutionEngine<T>

java.lang.Object
  extended by org.uncommons.watchmaker.framework.AbstractEvolutionEngine<T>
      extended by org.uncommons.watchmaker.framework.ConcurrentEvolutionEngine<T>
Type Parameters:
T - The type of entity that is to be evolved.
All Implemented Interfaces:
EvolutionEngine<T>

public class ConcurrentEvolutionEngine<T>
extends AbstractEvolutionEngine<T>

Multi-threaded generational EvolutionEngine. Fitness evaluations are performed in parallel on multi-processor, multi-core and hyper-threaded machines. Evolution (mutation, cross-over, etc.) occurs on the request thread but fitness evaluations are delegated to a pool of worker threads. All of the host's available processing units are used (i.e. on a quad-core machine, there will be four fitness evaluation worker threads).

This evolution engine is the most suitable for typical evolutionary algorithms. Evolutionary programs that execute in a restricted/managed environment that does not permit applications to manage their own threads should use the SequentialEvolutionEngine instead.

Author:
Daniel Dyer
See Also:
SequentialEvolutionEngine, CandidateFactory, FitnessEvaluator, SelectionStrategy, EvolutionaryOperator

Constructor Summary
ConcurrentEvolutionEngine(CandidateFactory<T> candidateFactory, EvolutionaryOperator<T> evolutionScheme, FitnessEvaluator<? super T> fitnessEvaluator, SelectionStrategy<? super T> selectionStrategy, Random rng)
          Creates a new evolution engine by specifying the various components required by an evolutionary algorithm.
ConcurrentEvolutionEngine(CandidateFactory<T> candidateFactory, EvolutionaryOperator<T> evolutionScheme, InteractiveSelection<T> selectionStrategy, Random rng)
          Creates a new evolution engine for an interactive evolutionary algorithm.
 
Method Summary
protected  List<EvaluatedCandidate<T>> evaluatePopulation(List<T> population)
          Takes a population, assigns a fitness score to each member and returns the members with their scores attached, sorted in descending order of fitness (descending order of fitness score for natural scores, ascending order of scores for non-natural scores).
 
Methods inherited from class org.uncommons.watchmaker.framework.AbstractEvolutionEngine
addEvolutionObserver, evolve, evolve, evolvePopulation, evolvePopulation, getFitnessEvaluator, getSatisfiedTerminationConditions, removeEvolutionObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentEvolutionEngine

public ConcurrentEvolutionEngine(CandidateFactory<T> candidateFactory,
                                 EvolutionaryOperator<T> evolutionScheme,
                                 FitnessEvaluator<? super T> fitnessEvaluator,
                                 SelectionStrategy<? super T> selectionStrategy,
                                 Random rng)
Creates a new evolution engine by specifying the various components required by an evolutionary algorithm.

Parameters:
candidateFactory - Factory used to create the initial population that is iteratively evolved.
evolutionScheme - The combination of evolutionary operators used to evolve the population at each generation.
fitnessEvaluator - A function for assigning fitness scores to candidate solutions.
selectionStrategy - A strategy for selecting which candidates survive to be evolved.
rng - The source of randomness used by all stochastic processes (including evolutionary operators and selection strategies).

ConcurrentEvolutionEngine

public ConcurrentEvolutionEngine(CandidateFactory<T> candidateFactory,
                                 EvolutionaryOperator<T> evolutionScheme,
                                 InteractiveSelection<T> selectionStrategy,
                                 Random rng)
Creates a new evolution engine for an interactive evolutionary algorithm. It is not necessary to specify a fitness evaluator for interactive evolution.

Parameters:
candidateFactory - Factory used to create the initial population that is iteratively evolved.
evolutionScheme - The combination of evolutionary operators used to evolve the population at each generation.
selectionStrategy - Interactive selection strategy configured with appropriate console.
rng - The source of randomness used by all stochastic processes (including evolutionary operators and selection strategies).
Method Detail

evaluatePopulation

protected List<EvaluatedCandidate<T>> evaluatePopulation(List<T> population)
Takes a population, assigns a fitness score to each member and returns the members with their scores attached, sorted in descending order of fitness (descending order of fitness score for natural scores, ascending order of scores for non-natural scores).

Specified by:
evaluatePopulation in class AbstractEvolutionEngine<T>
Parameters:
population - The population to evaluate (each candidate is assigned a fitness score).
Returns:
The evaluated population (a list of candidates with attached fitness scores).

Watchmaker Framework API
(Version 0.6.2)