public Individual getFittest() { Individual fittest = individuals[0]; // Loop through individuals to find fittest for (int i = 0; i < size(); i++) { if (fittest.getFitness() <= getIndividual(i).getFitness()) { fittest = getIndividual(i); } } return fittest; }
public void addIndividual(Individual newInd) { family.add(newInd); numIndividuals++; familyFitness.add(newInd.getFitness()); }