Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int max = individuals.size()/2;
- for (int i = 0; i < max; i++) {
- int index1 = -1;
- int index2 = -1;
- while (index1 == index2) {
- index1 = random.nextInt(individuals.size());
- index2 = random.nextInt(individuals.size());
- }
- Individual individual1 = individuals.remove(index1);
- Individual individual2 = individuals.remove(index2);
- //krzyżowanie
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement