Genetic Algorithms in Elixir: Ch 4 portfolio example pp66

Also since genetic.ex is already doing the sort by fitness why not stick with
def terminate?(population, _generation, _temperature),
do: hd(population).fitness > @target_fitness

For me a portfolio with @target_fitness 1600 was easily found with an age between 800-1100 on average.

also by this point in the book my terminate?() callback specification has three arguments, but book only shows two (missing _temperature).

1 Like