1dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/* 2dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Licensed to the Apache Software Foundation (ASF) under one or more 3dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * contributor license agreements. See the NOTICE file distributed with 4dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * this work for additional information regarding copyright ownership. 5dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * The ASF licenses this file to You under the Apache License, Version 2.0 6dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (the "License"); you may not use this file except in compliance with 7dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the License. You may obtain a copy of the License at 8dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 9dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * http://www.apache.org/licenses/LICENSE-2.0 10dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 11dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Unless required by applicable law or agreed to in writing, software 12dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * distributed under the License is distributed on an "AS IS" BASIS, 13dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * See the License for the specific language governing permissions and 15dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * limitations under the License. 16dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 17dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpackage org.apache.commons.math.genetics; 18dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 19dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport java.util.List; 20dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 21dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/** 22dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Interface indicating that the chromosome represents a permutation of objects. 23dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 24dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param <T> 25dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * type of the permuted objects 26dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.0 27dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @version $Revision: 811786 $ $Date: 2009-09-06 11:36:08 +0200 (dim. 06 sept. 2009) $ 28dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 29dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpublic interface PermutationChromosome<T> { 30dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 31dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 32dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Permutes the <code>sequence</code> of objects of type T according to the 33dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * permutation this chromosome represents. For example, if this chromosome 34dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * represents a permutation (3,0,1,2), and the unpermuted sequence is 35dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (a,b,c,d), this yields (d,a,b,c). 36dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 37dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param sequence 38dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the unpermuted (original) sequence of objects 39dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return permutation of <code>sequence</code> represented by this 40dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * permutation 41dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 42dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond List<T> decode(List<T> sequence); 43dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 44dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond} 45