In line 35 of the class RouletteWheelSelection > wheel = list(accumulate([i/sum_fit for i in fit])) When all individuals have the same fitnesses the value sum_fit is zero.