@Test public void newInstance() { final Genotype<DoubleGene> gt1 = Genotype.of( DoubleChromosome.of(DoubleGene.of(-Math.PI, Math.PI)), DoubleChromosome.of(DoubleGene.of(-300, 300), DoubleGene.of(-300, 300)), DoubleChromosome.of(DoubleGene.of(-0.5, 0.5), DoubleGene.of(-0.5, 0.5)) ); final Genotype<DoubleGene> gt2 = gt1.newInstance(); Assert.assertEquals(gt1.length(), gt2.length()); for (int i = 0; i < gt1.length(); ++i) { Chromosome<DoubleGene> ch1 = gt1.get(i); Chromosome<DoubleGene> ch2 = gt2.get(i); Assert.assertEquals(ch1.length(), ch2.length()); } }
@Override public Genotype<G> newInstance() { return new Genotype<>(_chromosomes.map(Factory::newInstance)); }
Genotype implements
		BaseSeq<Chromosome<G>>,
		Factory<Genotype<G>>,
		Verifiable,
		Serializable { @Override public Genotype<G> newInstance() { return new Genotype<>(_chromosomes.map(Factory::newInstance)); } }
Genotype implements
		BaseSeq<Chromosome<G>>,
		Factory<Genotype<G>>,
		Verifiable,
		Serializable { @Override public Genotype<G> newInstance() { return new Genotype<>(_chromosomes.map(Factory::newInstance)); } Genotype(final ISeq<? extends Chromosome<G>> chromosomes); }
Genotype implements
		BaseSeq<Chromosome<G>>,
		Factory<Genotype<G>>,
		Verifiable,
		Serializable { @Override public Genotype<G> newInstance() { return new Genotype<>(_chromosomes.map(Factory::newInstance)); } Genotype(final ISeq<? extends Chromosome<G>> chromosomes); @Override Chromosome<G> get(final int index); @Override int length(); Chromosome<G> chromosome(); G gene(); int geneCount(); @Override boolean isValid(); @Override Genotype<G> newInstance(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); @SafeVarargs static Genotype<G> of(
		final Chromosome<G> first,
		final Chromosome<G>... rest
	); static Genotype<G> of(final Factory<? extends Chromosome<G>> factory, final int n); static Genotype<G> of(final Iterable<? extends Chromosome<G>> chromosomes); }
Genotype implements
		BaseSeq<Chromosome<G>>,
		Factory<Genotype<G>>,
		Verifiable,
		Serializable { @Override public Genotype<G> newInstance() { return new Genotype<>(_chromosomes.map(Factory::newInstance)); } Genotype(final ISeq<? extends Chromosome<G>> chromosomes); @Override Chromosome<G> get(final int index); @Override int length(); Chromosome<G> chromosome(); G gene(); int geneCount(); @Override boolean isValid(); @Override Genotype<G> newInstance(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); @SafeVarargs static Genotype<G> of(
		final Chromosome<G> first,
		final Chromosome<G>... rest
	); static Genotype<G> of(final Factory<? extends Chromosome<G>> factory, final int n); static Genotype<G> of(final Iterable<? extends Chromosome<G>> chromosomes);  }