예제 #1
0
 public void saveState(PopulationInterface Pop) {
   oldFit = Pop.getBestFitness().clone();
   oldNorm = PhenotypeMetric.norm(oldFit);
   popFitCalls = Pop.getFunctionCalls();
   popGens = Pop.getGeneration();
   firstTime = false;
 }
예제 #2
0
 private boolean stagnationTimeHasPassed(PopulationInterface pop) {
   if (stagnationMeasure.isSelectedString("Fitness calls")) { // by fitness calls
     //			System.out.println("stagnationTimeHasPassed returns " + ((pop.getFunctionCalls() -
     // popFitCalls) >= m_stagTime) + " after " + (pop.getFunctionCalls() - popFitCalls));
     return (pop.getFunctionCalls() - popFitCalls) >= m_stagTime;
   } else { // by generation
     //			System.out.println("stagnationTimeHasPassed returns " + ((pop.getFunctionCalls() -
     // popGens) >= m_stagTime) + " after " + (pop.getFunctionCalls() - popGens));
     return (pop.getGeneration() - popGens) >= m_stagTime;
   }
 }