Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)

org.uncommons.watchmaker.framework.operators
Class ListOperator<T>

java.lang.Object
  extended by org.uncommons.watchmaker.framework.operators.ListOperator<T>
Type Parameters:
T - The element type of the lists to be mutated.
All Implemented Interfaces:
EvolutionaryOperator<List<T>>

public class ListOperator<T>
extends Object
implements EvolutionaryOperator<List<T>>

A higher-order evolutionary operator that is applied to populations made up of lists. In such populations, each candidate solution is itself a list and this operator is applied to the list contents rather than the candidate. It is analogous to the map function in functional programming languages.

For example, if the evolved population consists of candidates that are lists of strings, we could use a ListOperator to wrap an operator of type String and convert it to an operator that works with lists of Strings.

Author:
Daniel Dyer

Constructor Summary
ListOperator(EvolutionaryOperator<T> delegate)
           
 
Method Summary
 List<List<T>> apply(List<List<T>> selectedCandidates, Random rng)
          Applies the configured operator to each list candidate, operating on the elements that make up a candidate rather than on the list of candidates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListOperator

public ListOperator(EvolutionaryOperator<T> delegate)
Parameters:
delegate - The evolutionary operator that will be applied to each list candidate.
Method Detail

apply

public List<List<T>> apply(List<List<T>> selectedCandidates,
                           Random rng)
Applies the configured operator to each list candidate, operating on the elements that make up a candidate rather than on the list of candidates. candidates and returns the results.

Specified by:
apply in interface EvolutionaryOperator<List<T>>
Parameters:
selectedCandidates - A list of list candidates.
rng - A source of randomness.
Returns:
The result of applying the configured operator to each element in each list candidates.

Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)