@Test public void mutateInvalidGene() { final var mutator = new GaussianMutator<DoubleGene, Double>() { public DoubleGene mutate(final DoubleGene gene, final Random random) { return super.mutate(gene, random); } }; final DoubleGene gene = DoubleGene.of(0.9, 5, 1); Assert.assertFalse(gene.isValid()); final DoubleGene gene1 = mutator.mutate(gene, new Random()); Assert.assertSame(gene1, gene); }
@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();  }