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

**URL:** <https://forum.devtalk.com/t/genetic-algorithms-in-elixir-updating-the-chromosome-chapter-3-p-43/4157>\
**Category:** PragProg Customers\
**Tags:** book-genetic-algorithms-in-elixir, errata\
**Created:** [18 November 2020 10:44 UTC](https://forum.devtalk.com/t/genetic-algorithms-in-elixir-updating-the-chromosome-chapter-3-p-43/4157 "2020-11-18T10:44:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahetland](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@ahetland](https://forum.devtalk.com/u/ahetland)\
**Post date:** [18 November 2020 10:44 UTC](https://forum.devtalk.com/t/genetic-algorithms-in-elixir-updating-the-chromosome-chapter-3-p-43/4157/1 "2020-11-18T10:44:51Z")

</div>

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)}
