Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)

org.uncommons.watchmaker.framework.interactive
Class InteractiveSelection<T>

java.lang.Object
  extended by org.uncommons.watchmaker.framework.interactive.InteractiveSelection<T>
Type Parameters:
T - The type of evolved entity that can be selected by this class.
All Implemented Interfaces:
SelectionStrategy<T>

public class InteractiveSelection<T>
extends Object
implements SelectionStrategy<T>

Special selection strategy used for interactive evolutionary algorithms.

Author:
Daniel Dyer

Constructor Summary
InteractiveSelection(Console<R> console, Renderer<T,R> renderer, int groupSize, int maxSelectionsPerGeneration)
           
InteractiveSelection(Console<T> console, int groupSize, int maxSelectionsPerGeneration)
           
 
Method Summary
<S extends T>
List<S>
select(List<EvaluatedCandidate<S>> population, boolean naturalFitnessScores, int selectionSize, Random rng)
          Select the specified number of candidates from the population.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InteractiveSelection

public InteractiveSelection(Console<R> console,
                            Renderer<T,R> renderer,
                            int groupSize,
                            int maxSelectionsPerGeneration)
Type Parameters:
R - The type of object that can be displayed by the specified console. The specified renderer must be able to map evolved entities into objects of this type.
Parameters:
console - The user interface (graphical, textual or other) used to present a selection choice to the user.
renderer - A renderer used to map the evolved entities to objects that can be processed by the supplied console.
groupSize - The number of candidates to present to the user at once (the user selects one from this number).
maxSelectionsPerGeneration - The maximum number of selections that the user will be asked to make for each generation of the evolutionary algorithm. If this number is lower than the required selection size, the user's selections will be repeated to make up the shortfall. The purpose of this setting is two-fold. Firstly it minimises user fatigue. Secondly, it can be used to increase selection pressure. In the extreme case, a setting of 1 will ensure that members of the subsequent generation are all descended from a single parent.

InteractiveSelection

public InteractiveSelection(Console<T> console,
                            int groupSize,
                            int maxSelectionsPerGeneration)
Parameters:
console - The user interface (graphical, textual or other) used to present a selection choice to the user.
groupSize - The number of candidates to present to the user at once (the user selects one from this number).
maxSelectionsPerGeneration - The maximum number of selections that the user will be asked to make for each generation of the evolutionary algorithm. If this number is lower than the required selection size, the user's selections will be repeated to make up the shortfall. The purpose of this setting is two-fold. Firstly it minimises user fatigue. Secondly, it can be used to increase selection pressure. In the extreme case, a setting of 1 will ensure that members of the subsequent generation are all descended from a single parent.
Method Detail

select

public <S extends T> List<S> select(List<EvaluatedCandidate<S>> population,
                                    boolean naturalFitnessScores,
                                    int selectionSize,
                                    Random rng)

Select the specified number of candidates from the population. Implementations may assume that the population is sorted in descending order according to fitness (so the fittest individual is the first item in the list).

It is an error to call this method with an empty or null population.

Specified by:
select in interface SelectionStrategy<T>
Type Parameters:
S - The type of evolved entity that we are selecting, a sub-type of T.
Parameters:
population - The population from which to select.
naturalFitnessScores - Whether higher fitness values represent fitter individuals or not.
selectionSize - The number of individual selections to make (not necessarily the number of distinct candidates to select, since the same individual may potentially be selected more than once).
rng - Source of randomness for stochastic selection strategies.
Returns:
A list containing the selected candidates. Some individual canidates may potentially have been selected multiple times.

Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)