def compute_fitness_cdf(chromosomes, ga):
ga.sort(chromosomes)<EOL>fitness = [ga.eval_fitness(c) for c in chromosomes]<EOL>min_fit = min(fitness)<EOL>fit_range = max(fitness) - min_fit<EOL>if fit_range == <NUM_LIT:0>:<EOL><INDENT>n = len(chromosomes)<EOL>return [i / n for i in range(<NUM_LIT:1>, n + <NUM_LIT:1>)]<EOL><DEDENT>return [(fit - min_fit) / fit_range for fit in fitness]<EOL>
Return a list of fitness-weighted cumulative probabilities for a set of chromosomes.

chromosomes:  chromosomes to use for fitness-based calculations
ga:  ``algorithms.BaseGeneticAlgorithm`` used to obtain fitness values using its ``eval_fitness`` method

return:  list of fitness-weighted cumulative probabilities in [0, 1]