docs: def _update(self, es):
          """Test termination criteria and update dictionary
  
          """
          if es is None:
              es = self.es
          assert es is not None
  
          if es.countiter == 0:  # in this case termination tests fail
              self.__init__()
              return self
  
          self.lastiter = es.countiter
          self.es = es
  
          self.clear()  # compute conditions from scratch
  
          N = es.N
          opts = es.opts
          self.opts = opts  # a hack to get _addstop going
  
          # fitness: generic criterion, user defined w/o default
          self._addstop('ftarget',
                        es.best.f < opts['ftarget'])
          # maxiter, maxfevals: generic criteria
          self._addstop('maxfevals',
                        es.countevals - 1 >= opts['maxfevals'])
          self._addstop('maxiter',
                        ## meta_parameters.maxiter_multiplier == 1.0
                        es.countiter >= 1.0 * opts['maxiter'])
          # tolx, tolfacupx: generic criteria
          # tolfun, tolfunhist (CEC:tolfun includes hist)
          self._addstop('tolx',
                        all([es.sigma * xi < opts['tolx'] for xi in es.sigma_vec * es.pc]) and
                        all([es.sigma * xi < opts['tolx'] for xi in es.sigma_vec * sqrt(es.dC)]))
          self._addstop('tolfacupx',
                        any(es.sigma * es.sigma_vec * sqrt(es.dC) >
                            es.sigma0 * es.sigma_vec0 * opts['tolfacupx']))
          self._addstop('tolfun',
                        es.fit.fit[-1] - es.fit.fit[0] < opts['tolfun'] and
                        max(es.fit.hist) - min(es.fit.hist) < opts['tolfun'])
          self._addstop('tolfunhist',
                        len(es.fit.hist) > 9 and
                        max(es.fit.hist) - min(es.fit.hist) < opts['tolfunhist'])
  
          # worst seen false positive: table N=80,lam=80, getting worse for fevals=35e3 \approx 50 * N**1.5
          # but the median is not so much getting worse
          # / 5 reflects the sparsity of histbest/median
          # / 2 reflects the left and right part to be compared
          ## meta_parameters.tolstagnation_multiplier == 1.0
          l = int(max(( 1.0 * opts['tolstagnation'] / 5. / 2, len(es.fit.histbest) / 10)))
          # TODO: why max(..., len(histbest)/10) ???
          # TODO: the problem in the beginning is only with best ==> ???
          # equality should handle flat fitness
          self._addstop('tolstagnation',  # leads sometimes early stop on ftablet, fcigtab, N>=50?
                        1 < 3 and opts['tolstagnation'] and es.countiter > N * (5 + 100 / es.popsize) and
                        len(es.fit.histbest) > 100 and 2 * l < len(es.fit.histbest) and
                        np.median(es.fit.histmedian[:l]) >= np.median(es.fit.histmedian[l:2 * l]) and
                        np.median(es.fit.histbest[:l]) >= np.median(es.fit.histbest[l:2 * l]))
          # iiinteger: stagnation termination can prevent to find the optimum
  
          self._addstop('tolupsigma', opts['tolupsigma'] and
                        es.sigma / np.max(es.D) > es.sigma0 * opts['tolupsigma'])
  
          if 1 < 3:
              # non-user defined, method specific
              # noeffectaxis (CEC: 0.1sigma), noeffectcoord (CEC:0.2sigma), conditioncov
              idx = np.where(es.mean == es.mean + 0.2 * es.sigma *
                                      es.sigma_vec * es.dC**0.5)[0]
              self._addstop('noeffectcoord', any(idx), idx)
  #                         any([es.mean[i] == es.mean[i] + 0.2 * es.sigma *
  #                                                         (es.sigma_vec if isscalar(es.sigma_vec) else es.sigma_vec[i]) *
  #                                                         sqrt(es.dC[i])
  #                              for i in xrange(N)])
  #                )
              if opts['CMA_diagonal'] is not True and es.countiter > opts['CMA_diagonal']:
                  i = es.countiter % N
                  self._addstop('noeffectaxis',
                               sum(es.mean == es.mean + 0.1 * es.sigma * es.D[i] * es.B[:, i]) == N)
              self._addstop('conditioncov',
                           es.D[-1] > 1e7 * es.D[0], 1e14)  # TODO
  
              self._addstop('callback', es.callbackstop)  # termination_callback
          try:
              with open(self.opts['signals_filename'], 'r') as f:
                  for line in f.readlines():
                      words = line.split()
                      if len(words) < 2 or words[0].startswith(('#', '%')):
                          continue
                      if words[0] == 'stop' and words[1] == 'now':
                          if len(words) > 2 and not words[2].startswith(
                                  self.opts['verb_filenameprefix']):
                              continue
                          self._addstop('file_signal', True, "stop now")
                          break
          except IOError:
              pass
  
          if len(self):
              self._addstop('flat fitness: please (re)consider how to compute the fitness more elaborate',
                           len(es.fit.hist) > 9 and
                           max(es.fit.hist) == min(es.fit.hist))
          return self