Class ObjectArrayPermutationFactory<T>
- java.lang.Object
-
- org.uncommons.watchmaker.framework.factories.AbstractCandidateFactory<T[]>
-
- org.uncommons.watchmaker.framework.factories.ObjectArrayPermutationFactory<T>
-
- Type Parameters:
T
- The element type of the arrays created.
- All Implemented Interfaces:
CandidateFactory<T[]>
public class ObjectArrayPermutationFactory<T> extends AbstractCandidateFactory<T[]>
Generates random candidates from a set of elements. Each candidate is a random permutation of the full set of elements.
-
-
Constructor Summary
Constructors Constructor Description ObjectArrayPermutationFactory(T[] elements)
Creates a factory that creates arrays that contain each of the specified elements exactly once.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T[]
generateRandomCandidate(Random rng)
Generates a random permutation from the configured elements.-
Methods inherited from class org.uncommons.watchmaker.framework.factories.AbstractCandidateFactory
generateInitialPopulation, generateInitialPopulation
-
-
-
-
Constructor Detail
-
ObjectArrayPermutationFactory
public ObjectArrayPermutationFactory(T[] elements)
Creates a factory that creates arrays that contain each of the specified elements exactly once. The ordering of those elements within generated arrays is random.- Parameters:
elements
- The elements to permute.
-
-