001 /*
002 * Copyright 2011 Christian Kumpe http://kumpe.de/christian/java
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package de.kumpe.hadooptimizer;
017
018 import java.io.Serializable;
019 import java.util.Collection;
020
021 /**
022 * A {@link Recombiner} combines the given {@code n} parents to form {@code m}
023 * children.
024 * <p>
025 * E.g. by cutting two parents somewhere in the middle at the same point and
026 * forming two new children:
027 * <ul>
028 * <li>the first with the front end of the first parent and the back end of the
029 * other
030 * <li>the second vice versa.
031 * </ul>
032 *
033 * @param <I>
034 * the individuals' type
035 *
036 * @author <a href="http://kumpe.de/christian/java">Christian Kumpe</a>
037 */
038 public interface Recombiner<I> extends Serializable {
039 /**
040 * Recombines the children from the parents in the given
041 * <code>evaluationResults</code>.
042 *
043 * @return the <b>newly</b> created children, they may not be modified
044 * parent-objects
045 *
046 * @see Recombiner
047 */
048 Collection<I> recombine(Collection<EvaluationResult<I>> parents);
049 }