def compete(self, chromosomes):
<EOL>self.sort(chromosomes)<EOL>min_fit = self.get_fitness(chromosomes[<NUM_LIT:0>])<EOL>max_fit = self.get_fitness(chromosomes[-<NUM_LIT:1>])<EOL>if min_fit < self.min_fit_ever:<EOL><INDENT>self.min_fit_ever = min_fit<EOL><DEDENT>if max_fit > self.max_fit_ever:<EOL><INDENT>self.max_fit_ever = max_fit<EOL><DEDENT>overall_fit_range = self.max_fit_ever - self.min_fit_ever  <EOL>current_fit_range = max_fit - min_fit                      <EOL>survivors = []<EOL>for chromosome in chromosomes:<EOL><INDENT>fit = self.get_fitness(chromosome)<EOL>p_survival_absolute = (fit - self.min_fit_ever) / overall_fit_range if overall_fit_range != <NUM_LIT:0> else <NUM_LIT:1><EOL>p_survival_relative = (fit - min_fit) / current_fit_range if current_fit_range != <NUM_LIT:0> else <NUM_LIT:1><EOL>p_survival = p_survival_absolute * self.abs_fit_weight + p_survival_relative * self.rel_fit_weight<EOL>if random.random() < p_survival:<EOL><INDENT>survivors.append(chromosome)<EOL><DEDENT><DEDENT>if not survivors:<EOL><INDENT>return chromosomes<EOL><DEDENT>return survivors<EOL>
Simulate competition/survival of the fittest.

The fitness of each chromosome is used to calculate a survival probability
based on how it compares to the overall fitness range of the run and the
fitness range of the current generation. The ``abs_fit_weight`` and 
``rel_fit_weight`` attributes determine the degree to which overall and
current fitness ranges affect the final survival probability.

return:  list of surviving chromosomes