package org.jenetics.example;

import org.jenetics.DoubleGene;
import org.jenetics.Mutator;
import org.jenetics.TruncationSelector;
import org.jenetics.engine.Codec;
import org.jenetics.engine.Engine;
import org.jenetics.engine.EvolutionResult;
import org.jenetics.engine.codecs;
import org.jenetics.util.DoubleRange;

/**
 * The (μ, λ) evolution strategy is among the simplest ES algorithms.
 *
 * 1) We begin with a population of (typically) λ number of individuals,
 *    generated randomly.
 * 2) μ is the number of parents which survive. This is realized by setting the
 *    survivors selector to the TruncationSelector.
 * 3) λ is the number of kids that the μ parents make in total. Since only the
 *    offspring are altered, we also use the TruncationSelector for the offspring.
 *
 * @author Franz Wilhelmstötter <franz.wilhelmstoetter@emarsys.com>
 */
public class MLStrategy {

	static double fitness(final double x) {
		return x;
	}

	public static void main(final String[] args) {
		final int μ = 5;
		final int λ = 20;
		final double p = 0.2;

		final Codec<Double, DoubleGene> codec = codecs
			.ofScalar(DoubleRange.of(0, 1));

		final Engine<DoubleGene, Double> engine = Engine
			.builder(MLStrategy::fitness, codec)
			.populationSize(λ)
			.survivorsSize(0)
			.offspringSelector(new TruncationSelector<>(μ))
			.alterers(new Mutator<>(p))
			.build();

		System.out.println(
			codec.decode(
				engine.stream()
					.limit(100)
					.collect(EvolutionResult.toBestGenotype())
			)
		);
	}

}

@@ -800,23 +800,39 @@
 hor 
-F
+%3Ca href=%22mailto:f
 ranz
- W
+.w
 ilhelmst
 %C3%B6tte
@@ -831,30 +831,38 @@
 lmst
-%C3%B6
+oe
 tter
- %3Cf
+@gmx.at%22%3EF
 ranz
-.w
+ W
 ilhelmst
 oett
@@ -861,27 +861,67 @@
 lmst
-oe
+%C3%B6
 tter
-@emarsys.com%3E
+%3C/a%3E%0A * @version !__version__!%0A * @since !__version__!
 %0A */

Fix Javadoc.