@Test public void testSetGetChromosome() { LongChromosome c1 = LongChromosome.of(0, 100, 10); LongChromosome c2 = LongChromosome.of(0, 100, 10); @SuppressWarnings("unused") LongChromosome c3 = LongChromosome.of(0, 100, 10); @SuppressWarnings("unused") Genotype<LongGene> g = Genotype.of(c1, c2); }
@SafeVarargs public static <G extends Gene<?, G>> Genotype<G> of( final Chromosome<G> first, final Chromosome<G>... rest ) { final MSeq<Chromosome<G>> seq = MSeq.ofLength(1 + rest.length); seq.set(0, first); for (int i = 0; i < rest.length; ++i) { seq.set(i + 1, rest[i]); } return new Genotype<>(seq.toISeq()); }
Genotype implements
		BaseSeq<Chromosome<G>>,
		Factory<Genotype<G>>,
		Verifiable,
		Serializable { @SafeVarargs public static <G extends Gene<?, G>> Genotype<G> of( final Chromosome<G> first, final Chromosome<G>... rest ) { final MSeq<Chromosome<G>> seq = MSeq.ofLength(1 + rest.length); seq.set(0, first); for (int i = 0; i < rest.length; ++i) { seq.set(i + 1, rest[i]); } return new Genotype<>(seq.toISeq()); } }
Genotype implements
		BaseSeq<Chromosome<G>>,
		Factory<Genotype<G>>,
		Verifiable,
		Serializable { @SafeVarargs public static <G extends Gene<?, G>> Genotype<G> of( final Chromosome<G> first, final Chromosome<G>... rest ) { final MSeq<Chromosome<G>> seq = MSeq.ofLength(1 + rest.length); seq.set(0, first); for (int i = 0; i < rest.length; ++i) { seq.set(i + 1, rest[i]); } return new Genotype<>(seq.toISeq()); } Genotype(final ISeq<? extends Chromosome<G>> chromosomes); }
Genotype implements
		BaseSeq<Chromosome<G>>,
		Factory<Genotype<G>>,
		Verifiable,
		Serializable { @SafeVarargs public static <G extends Gene<?, G>> Genotype<G> of( final Chromosome<G> first, final Chromosome<G>... rest ) { final MSeq<Chromosome<G>> seq = MSeq.ofLength(1 + rest.length); seq.set(0, first); for (int i = 0; i < rest.length; ++i) { seq.set(i + 1, rest[i]); } return new Genotype<>(seq.toISeq()); } 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 { @SafeVarargs public static <G extends Gene<?, G>> Genotype<G> of( final Chromosome<G> first, final Chromosome<G>... rest ) { final MSeq<Chromosome<G>> seq = MSeq.ofLength(1 + rest.length); seq.set(0, first); for (int i = 0; i < rest.length; ++i) { seq.set(i + 1, rest[i]); } return new Genotype<>(seq.toISeq()); } 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);  }