The code of the run/4
function at the bottom of page 28 is not updated with the opts param in the inner function calls:
Finally, pass opts to every function in run and evolve :
def run(genotype, fitness_function, max_fitness, opts \\ []) do
population = initialize(genotype)
population
|> evolve(fitness_function, max_fitness)
end
should read:
def run(genotype, fitness_function, max_fitness, opts \\ []) do
population = initialize(genotype, opts)
population
|> evolve(fitness_function, max_fitness, opts)
end
(I’m really enjoying the book! )