/*
 * Java Genetic Algorithm Library (@__identifier__@).
 * Copyright (c) @__year__@ Franz Wilhelmstötter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author:
 *    Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)
 */
package org.jenetics.internal.engine;

/**
 * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 * @since 3.0
 * @version 3.0 &mdash; <em>$Date: 2014-07-29 $</em>
 */
public class SelectStage {
}

@@ -777,190 +777,1553 @@
 e;%0A%0A
-/**%0A * @author %3Ca href=%22mailto:franz.wilhelmstoetter@gmx.at%22%3EFranz Wilhelmst%C3%B6tter%3C/a%3E%0A * @since 3.0%0A * @version 3.0 &mdash; %3Cem%3E$Date: 2014-07-29 $%3C/em%3E%0A */%0Apublic class SelectStage %7B
+import static org.jenetics.internal.util.NanoClock.timing;%0A%0Aimport java.util.concurrent.CompletableFuture;%0Aimport java.util.concurrent.CompletionStage;%0Aimport java.util.concurrent.Executor;%0Aimport java.util.concurrent.atomic.AtomicLong;%0A%0Aimport org.jenetics.Gene;%0Aimport org.jenetics.Optimize;%0Aimport org.jenetics.Population;%0Aimport org.jenetics.Selector;%0A%0A/**%0A * @author %3Ca href=%22mailto:franz.wilhelmstoetter@gmx.at%22%3EFranz Wilhelmst%C3%B6tter%3C/a%3E%0A * @since 3.0%0A * @version 3.0 &mdash; %3Cem%3E$Date: 2014-07-29 $%3C/em%3E%0A */%0Apublic class SelectStage%3C%0A%09G extends Gene%3C?, G%3E,%0A%09C extends Comparable%3C? super C%3E%0A%3E%0A%7B%0A%0A%09public int survivors;%0A%09public int offspring;%0A%09private Selector%3CG, C%3E survivorSelector;%0A%09private Selector%3CG, C%3E offspringSelector;%0A%09public Optimize optimize;%0A%09public Executor executor;%0A%0A%09public final AtomicLong time = new AtomicLong(0);%0A%0A%09public Result select(final Population%3CG, C%3E population) %7B%0A%09%09return new Result(%0A%09%09%09CompletableFuture.supplyAsync(timing(time, () -%3E%0A%09%09%09%09survivorSelector.select(population, survivors, optimize)),%0A%09%09%09%09executor%0A%09%09%09),%0A%09%09%09CompletableFuture.supplyAsync(timing(time, () -%3E%0A%09%09%09%09offspringSelector.select(population, offspring, optimize)),%0A%09%09%09%09executor%0A%09%09%09)%0A%09%09);%0A%09%7D%0A%0A%09public final class Result %7B%0A%09%09public final CompletionStage%3CPopulation%3CG, C%3E%3E survivors;%0A%09%09public final CompletionStage%3CPopulation%3CG, C%3E%3E offspring;%0A%0A%09%09private Result(%0A%09%09%09final CompletionStage%3CPopulation%3CG, C%3E%3E survivors,%0A%09%09%09final CompletionStage%3CPopulation%3CG, C%3E%3E offspring%0A%09%09) %7B%0A%09%09%09this.survivors = survivors;%0A%09%09%09this.offspring = offspring;%0A%09%09%7D%0A%09%7D%0A
 %0A%7D%0A

Implement 'SelectStage' class.