/** evolve Array of solvers solvers in sequencial (no MultiThread) */ @Override public void iterate() { this.numEvaluations = 0; this.numGeneration = 0; parents.clear(); // evolve all solvers for (EAsolver s : arrayOfSolvers) { if (!s.stop.isDone(s)) { s.iterate(); // iterate solver updateHallOfFame(s.parents); } parents.addAll(s.hallOfFame); // get maximum of evaluations this.numEvaluations = s.numEvaluations > this.numEvaluations ? s.numEvaluations : this.numEvaluations; // get max of generation this.numGeneration = s.numGeneration > this.numGeneration ? s.numGeneration : this.numGeneration; // this.numEvaluations += s.numEvaluations; // this.numGeneration += s.numGeneration; } // parents.addAll(hallOfFame); // update stastistics ((ReportSolverArray) report).updateStats(arrayOfSolvers); }
public void iterate() { // solver not done if (!mySolver.isDone()) { // next generation mySolver.iterate(); // notify changes fireEvolutionChanges(mySolver); // solver done if (mySolver.isDone()) { // notify complete fireEvolutionComplete(mySolver); } } }