Top Description Methods
org.apache.commons.math3.genetics

public Interface PermutationChromosome<T>

Known Direct Implementers
org.apache.commons.math3.genetics.RandomKey
Type Parameters
<T>
type of the permuted objects
Imports
java.util.List

Interface indicating that the chromosome represents a permutation of objects.
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public List<T>

Returns:

permutation of sequence represented by this permutation
decode
(List<T>
the unpermuted (original) sequence of objects
sequence
)

Permutes the sequence of objects of type T according to the permutation this chromosome represents.

Method Detail

decodeback to summary
public List<T> decode(List<T> sequence)

Permutes the sequence of objects of type T according to the permutation this chromosome represents. For example, if this chromosome represents a permutation (3,0,1,2), and the unpermuted sequence is (a,b,c,d), this yields (d,a,b,c).

Parameters
sequence:List<T>

the unpermuted (original) sequence of objects

Returns:List<T>

permutation of sequence represented by this permutation