Sample as roulette wheel selection, but with lower variance and no bias towards highly fit individuals.
Distributing offspring counts to species:
scores = [sum(g.adjusted_fitness for g in s) for s in species]
weights = [(s - min_score) if (s - min_score) > 0 else 0.0 for s in scores]
total = sum(weights)
# SUS:
step = total / self.config.population_size
start = random.uniform(0.0, step)
cumulative = list(accumulate(weights))
counts = [0] * n_species
idx = 0
for k in range(self.config.population_size):
pointer = start + k * step
while idx < n_species - 1 and cumulative[idx] < pointer:
idx += 1
counts[idx] += 1
return counts