private void swapNumbers(int i, int j) { Zeester temp = new Zeester(pop[i].getGene(), pop[i].getScore()); pop[i] = new Zeester(pop[j].getGene(), pop[j].getScore()); pop[j] = new Zeester(temp.getGene(), temp.getScore()); }
//Mates to knapsacks public Zeester mate(Zeester p1, Zeester p2) { Zeester child; child = crossover(p1.getGene(), p2.getGene()); if (Random.value > 0.5f) { child = mutation(child.getGene()); } return(child); }