Skip to content

Commit

Permalink
#169: Improve ES code example.
Browse files Browse the repository at this point in the history
  • Loading branch information
jenetics committed Apr 16, 2017
1 parent 32b7cb0 commit 1759de8
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -29,6 +29,7 @@ static double fitness(final double 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));
Expand All @@ -38,7 +39,7 @@ public static void main(final String[] args) {
.populationSize(λ)
.survivorsSize(μ)
.selector(new TruncationSelector<>(μ))
.alterers(new Mutator<>())
.alterers(new Mutator<>(p))
.build();
}

Expand Down

0 comments on commit 1759de8

Please sign in to comment.