Watchmaker Framework API
(Version 0.6.2)

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

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

public class SequentialEvolutionEngine<T>
extends AbstractEvolutionEngine<T>

Single-threaded generational EvolutionEngine. All work is completed synchronously on the request thread. This implementation does not take advantage of the parallelism offered by multi-processor, multi-core or hyper-threaded machines.

This evolution engine is suitable for restricted/managed environments (where it is not permitted for applications to manage their own threads). Most applications should use the ConcurrentEvolutionEngine instead.

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

Constructor Summary
SequentialEvolutionEngine(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.
SequentialEvolutionEngine(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.
 
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

SequentialEvolutionEngine

public SequentialEvolutionEngine(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).

SequentialEvolutionEngine

public SequentialEvolutionEngine(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. Order is not important since the returned population will be sorted later if required.

Specified by:
evaluatePopulation in class AbstractEvolutionEngine<T>
Parameters:
population - The population of evolved candidate to be evaluated.
Returns:
A list containing each of the candidates with an attached fitness score.

Watchmaker Framework API
(Version 0.6.2)