int iPrelimChrom, iPrelimChromToUsePerRun;
  public int evolve() {    int iGen;    int iPrelimChrom, iPrelimChromToUsePerRun;        if (this.shouldDoExhaustive()) {      this.doExhaustiveSearch();      return 0;    }        log("GA start time: " + new Date().toString());        /*if (numPrelimRuns > 0) {      iPrelimChrom = 0;      //number of fittest prelim chromosomes to use with final run      iPrelimChromToUsePerRun = populationDim / numPrelimRuns;            for (int iPrelimRuns = 1; iPrelimRuns <= numPrelimRuns; iPrelimRuns++) {        iGen = 0;        initPopulation();                //create a somewhat fit chromosome population for this prelim run        while (iGen < maxPrelimGenerations) {          log(iPrelimRuns + " of " + numPrelimRuns + " prelim runs --> " + (iGen+1) + " of " + maxPrelimGenerations + " generations");                    computeFitnessRankings();          doGeneticMating();          copyNextGenToThisGen();                    if (computeStatistics == true) {            this.genAvgFitness[iGen] = getAvgFitness();          }          iGen++;        }                computeFitnessRankings();                //copy these somewhat fit chromosomes to the main chromosome pool        int iNumPrelimSaved = 0;        for (int i=0; i < populationDim && iNumPrelimSaved < iPrelimChromToUsePerRun; i++)          if (this.chromosomes[i].fitnessRank >= populationDim-iPrelimChromToUsePerRun) {            this.prelimChrom[iPrelimChrom + iNumPrelimSaved].copyChromGenes(this.chromosomes[i]);  //store (remember) these fit chroms            iNumPrelimSaved++;          }        iPrelimChrom += iNumPrelimSaved;      }      for (int i=0; i < iPrelimChrom; i++)        this.chromosomes[i].copyChromGenes(this.prelimChrom[i]);      log("INITIAL POPULATION AFTER PRELIM RUNS:");    }    else      log("INITIAL POPULATION (NO PRELIM RUNS):");        //Add Preliminary Chromosomes to list box    addChromosomesToLog(0, 10);    */        iGen = 0;    boolean converged = false;    while (iGen < maxGenerations && !converged) {      computeFitnessRankings();      doGeneticMating();      copyNextGenToThisGen();            if (computeStatistics == true) {        this.genAvgFitness[iGen] = getAvgFitness();      }            if (iGen != 0 && iGen%5 == 0) {        this.doHeuristicPass();      }            if ( //test for improvement and convergence      (iGen > 5) &&       (this.getESquared() - (this.genAvgFitness[iGen]*this.genAvgFitness[iGen]) < .2*this.genAvgFitness[iGen]) &&       (this.genAvgFitness[iGen] - this.genAvgFitness[iGen - 1] <= 0)      ) {        converged = true;      }      iGen++;    }        log("GEN " + (iGen+1) + " AVG FITNESS = " + this.getAvgFitness());        addChromosomesToLog(iGen, 10);  //display Chromosomes to system.out        computeFitnessRankings();    log("Best Chromosome Found: ");    log(this.chromosomes[this.bestFitnessChromIndex].getGenesAsStr() + " Fitness= " + this.chromosomes[this.bestFitnessChromIndex].fitness);        log("GA end time: " + new Date().toString());    return(iGen);  }