8182838485868788899091
if (parent1 == null && probabilitySum >= pointer1) { parent1 = genome; } else if (probabilitySum >= pointer2) { return new Couple(parent1, genome); } } throw new IllegalStateException("this should never happen"); }
60616263646566
} private Couple getCouple(GenePool<GenericGenomeType> genePool) { Genome parent1 = selectMate(genePool); Genome parent2 = selectMate(genePool); return new Couple(parent1, parent2); }
545556575859606162
Genome[] genomes = genePool.toArray(); for (int i = 0; i < numberOfPairs; i++) { Genome parent1 = selectMate(genomes); Genome parent2 = selectMate(genomes); couples.add(new Couple(parent1, parent2)); } return couples; }