@Test(invocationCount = 20, successPercentage = 95) public void mutate() { final Random random = RandomRegistry.random(); final double min = 0; final double max = 10; final double mean = 5; final double var = Math.pow((max - min)/4.0, 2); final DoubleGene gene = DoubleGene.of(mean, min, max); final GaussianMutator<DoubleGene, Double> mutator = new GaussianMutator<>(); final Histogram<Double> histogram = Histogram.ofDouble(0.0, 10.0, 10); for (int i = 0; i < 10000; ++i) { final double value = mutator.mutate(gene, random).allele(); histogram.accept(value); } final Range<Double> domain = new Range<>(min, max); }
@Override protected G mutate(final G gene, final Random random) { return gene.isValid() ? mutate0(gene, random) : gene; }
GaussianMutator extends Mutator<G, C> { @Override protected G mutate(final G gene, final Random random) { return gene.isValid() ? mutate0(gene, random) : gene; } }
GaussianMutator extends Mutator<G, C> { @Override protected G mutate(final G gene, final Random random) { return gene.isValid() ? mutate0(gene, random) : gene; } GaussianMutator(final double probability);  GaussianMutator(); }
GaussianMutator extends Mutator<G, C> { @Override protected G mutate(final G gene, final Random random) { return gene.isValid() ? mutate0(gene, random) : gene; } GaussianMutator(final double probability);  GaussianMutator(); @Override String toString(); }
GaussianMutator extends Mutator<G, C> { @Override protected G mutate(final G gene, final Random random) { return gene.isValid() ? mutate0(gene, random) : gene; } GaussianMutator(final double probability);  GaussianMutator(); @Override String toString();  }