@Test public void map() { final var ch1 = DoubleChromosome.of(0, 1, 1000); final var ch2 = ch1.map(DoubleChromosomeTest::normalize); Assert.assertNotSame(ch2, ch1); Assert.assertEquals(ch2.toArray(), normalize(ch1.toArray())); }
public DoubleChromosome map(final Function<? super double[], double[]> f) { requireNonNull(f); final var range = DoubleRange.of(_min, _max); final var genes = DoubleStream.of(f.apply(toArray())) .mapToObj(v -> DoubleGene.of(v, range)) .collect(ISeq.toISeq()); return newInstance(genes); }
DoubleChromosome extends AbstractBoundedChromosome<Double, DoubleGene> implements
		NumericChromosome<Double, DoubleGene>,
		Serializable { public DoubleChromosome map(final Function<? super double[], double[]> f) { requireNonNull(f); final var range = DoubleRange.of(_min, _max); final var genes = DoubleStream.of(f.apply(toArray())) .mapToObj(v -> DoubleGene.of(v, range)) .collect(ISeq.toISeq()); return newInstance(genes); } }
DoubleChromosome extends AbstractBoundedChromosome<Double, DoubleGene> implements
		NumericChromosome<Double, DoubleGene>,
		Serializable { public DoubleChromosome map(final Function<? super double[], double[]> f) { requireNonNull(f); final var range = DoubleRange.of(_min, _max); final var genes = DoubleStream.of(f.apply(toArray())) .mapToObj(v -> DoubleGene.of(v, range)) .collect(ISeq.toISeq()); return newInstance(genes); } protected  DoubleChromosome(
		final ISeq<DoubleGene> genes,
		final IntRange lengthRange
	); }
DoubleChromosome extends AbstractBoundedChromosome<Double, DoubleGene> implements
		NumericChromosome<Double, DoubleGene>,
		Serializable { public DoubleChromosome map(final Function<? super double[], double[]> f) { requireNonNull(f); final var range = DoubleRange.of(_min, _max); final var genes = DoubleStream.of(f.apply(toArray())) .mapToObj(v -> DoubleGene.of(v, range)) .collect(ISeq.toISeq()); return newInstance(genes); } protected  DoubleChromosome(
		final ISeq<DoubleGene> genes,
		final IntRange lengthRange
	); @Override DoubleChromosome newInstance(final ISeq<DoubleGene> genes); @Override DoubleChromosome newInstance(); DoubleChromosome map(final Function<? super double[], double[]> f); DoubleStream doubleStream(); double[] toArray(final double[] array); double[] toArray(); static DoubleChromosome of(final DoubleGene... genes); static DoubleChromosome of(final Iterable<DoubleGene> genes); static DoubleChromosome of(
		final double min,
		final double max,
		final IntRange lengthRange
	); static DoubleChromosome of(
		final double min,
		final double max,
		final int length
	); static DoubleChromosome of(
		final DoubleRange range,
		final IntRange lengthRange
	); static DoubleChromosome of(final DoubleRange range, final int length); static DoubleChromosome of(final double min, final double max); static DoubleChromosome of(final DoubleRange range); }
DoubleChromosome extends AbstractBoundedChromosome<Double, DoubleGene> implements
		NumericChromosome<Double, DoubleGene>,
		Serializable { public DoubleChromosome map(final Function<? super double[], double[]> f) { requireNonNull(f); final var range = DoubleRange.of(_min, _max); final var genes = DoubleStream.of(f.apply(toArray())) .mapToObj(v -> DoubleGene.of(v, range)) .collect(ISeq.toISeq()); return newInstance(genes); } protected  DoubleChromosome(
		final ISeq<DoubleGene> genes,
		final IntRange lengthRange
	); @Override DoubleChromosome newInstance(final ISeq<DoubleGene> genes); @Override DoubleChromosome newInstance(); DoubleChromosome map(final Function<? super double[], double[]> f); DoubleStream doubleStream(); double[] toArray(final double[] array); double[] toArray(); static DoubleChromosome of(final DoubleGene... genes); static DoubleChromosome of(final Iterable<DoubleGene> genes); static DoubleChromosome of(
		final double min,
		final double max,
		final IntRange lengthRange
	); static DoubleChromosome of(
		final double min,
		final double max,
		final int length
	); static DoubleChromosome of(
		final DoubleRange range,
		final IntRange lengthRange
	); static DoubleChromosome of(final DoubleRange range, final int length); static DoubleChromosome of(final double min, final double max); static DoubleChromosome of(final DoubleRange range);  }