def eaGenerateUpdate(toolbox, ngen, halloffame=None, stats=None, verbose=__debug__):
 logbook = tools.Logbook()
 logbook.header = (['gen', 'nevals'] + (stats.fields if stats else []))
 for gen in xrange(ngen):
  population = toolbox.generate()
  fitnesses = toolbox.map(toolbox.evaluate, population)
  for (ind, fit) in zip(population, fitnesses):
   ind.fitness.values = fit
  if (halloffame is not None):
   halloffame.update(population)
  toolbox.update(population)
  record = (stats.compile(population) if (stats is not None) else {})
  logbook.record(gen=gen, nevals=len(population), **record)
  if verbose:
   print logbook.stream
 return (population, logbook)

def eaGenerateUpdate ( toolbox , ngen , halloffame = None , stats = None , verbose = __debug__ ) : logbook = tools . Logbook ( ) logbook . header = ( [ 'gen' , 'nevals' ] + ( stats . fields if stats else [ ] ) ) for gen in xrange ( ngen ) : population = toolbox . generate ( ) fitnesses = toolbox . map ( toolbox . evaluate , population ) for ( ind , fit ) in zip ( population , fitnesses ) : ind . fitness . values = fit if ( halloffame is not None ) : halloffame . update ( population ) toolbox . update ( population ) record = ( stats . compile ( population ) if ( stats is not None ) else { } ) logbook . record ( gen = gen , nevals = len ( population ) , ** record ) if verbose : print logbook . stream return ( population , logbook )
this is algorithm implements the ask-tell model proposed in [colette2010]_ .