def main_generator(self):
    objective = self.objective
    driver = self.driver

    # test the entire initial simplex
    self.simplex_points = list(map(driver.get_configuration,
                                   self.initial_simplex()))
    if len(self.simplex_points) <= 1:
      log.warning("only 1 point in simplex, will not use %s", self.name)
      return

    log.debug("initial points")
    for p in self.simplex_points:
      self.yield_nonblocking(p)
    yield None  # wait until results are ready
    self.simplex_points.sort(cmp=objective.compare)

    while not self.convergence_criterea():
      # set limit from worst point
      self.limit = objective.limit_from_config(self.simplex_points[-1])

      if log.isEnabledFor(logging.DEBUG):
        self.debug_log()

      reflected = self.reflected_simplex()
      yield None  # wait until results are ready
      reflected.sort(cmp=objective.compare)

      # this next condition implies reflected[0] < simplex_points[0] since
      # reflected is sorted and contains simplex_points[0] (saves a db query)
      if reflected[0] is not self.simplex_points[0]:
        expanded = self.expanded_simplex()
        yield None  # wait until results are ready
        expanded.sort(cmp=objective.compare)

        if objective.lt(expanded[0], reflected[0]):
          log.debug("expansion performed")
          self.simplex_points = expanded
        else:
          log.debug("reflection performed")
          self.simplex_points = reflected
      else:
        contracted = self.contracted_simplex()
        yield None  # wait until results are ready
        contracted.sort(cmp=objective.compare)

        log.debug("contraction performed")
        self.simplex_points = contracted
dataset/ETHPy150Open jansel/opentuner/opentuner/search/simplextechniques.py/Torczon.main_generator/original