Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)

org.uncommons.watchmaker.framework.factories
Class ListPermutationFactory<T>

java.lang.Object
  extended by org.uncommons.watchmaker.framework.factories.AbstractCandidateFactory<List<T>>
      extended by org.uncommons.watchmaker.framework.factories.ListPermutationFactory<T>
Type Parameters:
T - The component type of the lists created by this factory.
All Implemented Interfaces:
CandidateFactory<List<T>>

public class ListPermutationFactory<T>
extends AbstractCandidateFactory<List<T>>

Generates random candidates from a set of elements. Each candidate is a random permutation of the full set of elements.

Author:
Daniel Dyer

Constructor Summary
ListPermutationFactory(List<T> elements)
          Creates a factory that creates lists that contain each of the specified elements exactly once.
 
Method Summary
 List<T> generateRandomCandidate(Random rng)
          Generates a random permutation from the configured elements.
 
Methods inherited from class org.uncommons.watchmaker.framework.factories.AbstractCandidateFactory
generateInitialPopulation, generateInitialPopulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListPermutationFactory

public ListPermutationFactory(List<T> elements)
Creates a factory that creates lists that contain each of the specified elements exactly once. The ordering of those elements within generated lists is random.

Parameters:
elements - The elements to permute.
Method Detail

generateRandomCandidate

public List<T> generateRandomCandidate(Random rng)
Generates a random permutation from the configured elements.

Parameters:
rng - A source of randomness used to generate the random permutation.
Returns:
A random permutation.

Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)