Closed
Description
Add a method, which allows to create a sliced (chromosome) view onto a given Genotype
.
Genotype<G> slice(int fromIndex, int toIndex)
Usage:
final Genotype<DoubleGene> genotype = Genotype.of(
DoubleChromosome.of(0, 10, 100),
DoubleChromosome.of(0, 10, 50),
DoubleChromosome.of(0, 10, 40),
DoubleChromosome.of(0, 10, 10),
DoubleChromosome.of(0, 10, 30)
);
assert genotype.length() == 5;
final Genotype<DoubleGene> slice = genotype.slice(1, 3);
assert slice.length() == 2;