예제 #1
0
  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;
  }
예제 #2
0
 public void addIndividual(Individual newInd) {
   family.add(newInd);
   numIndividuals++;
   familyFitness.add(newInd.getFitness());
 }