Genetic Algorithms in Elixir: Updating the Chromosome Chapter 3 p. 43

Please use the following format for the title of this thread (then simply delete/replace this text with the content for the thread):

Title: Genetic Algorithms in Elixir p 43
Chromosome not updating

I changed the code to this in crossover:
{c1, c2} = {%Chromosome{p1 | genes: h1 ++ t2}, %Chromosome{p2 | genes: h2 ++ t1}}
and also in mutation:
%Chromosome{chromosome | genes: Enum.shuffle(chromosome.genes)}

2 Likes