docs: def paes_replacement(random, population, parents, offspring, args):
      """Replaces population using the Pareto Archived Evolution Strategy method.
      
      .. Arguments:
         random -- the random number generator object
         population -- the population of individuals
         parents -- the list of parent individuals
         offspring -- the list of offspring individuals
         args -- a dictionary of keyword arguments
      
      """
      archive = args['_ec'].archive
      archiver = args['_ec'].archiver
          
      survivors = []
      for p, o in zip(parents, offspring):
          if o == p:
              survivors.append(p)
          elif o in archive:
              survivors.append(p)
          elif o > p:
              archive = archiver(random, [o], archive, args)
              survivors.append(o)
          elif o >= p:
              for a in archive:
                  if o > a or o < a:
                      break
              if o >= a:
                  archive = archiver(random, [o], archive, args)
                  if o > a or archiver.grid_population[o.grid_location] <= archiver.grid_population[p.grid_location]:
                      survivors.append(o)
                  else:
                      survivors.append(p)
              else:
                  survivors.append(p)
          else:
              survivors.append(p)
      return survivors