Answers.Body: <p>In GE, the genotype is a linear sequence of codons. By &quot;wrapping&quot; it, you make it a circular sequence that never ends. It allows you to build a bigger tree, while having only a few codons. Still, it is possible to find such a combination of a genotype and a grammar that defines an infinitely deep expansion — such combinations are hardly suited for practical purposes.</p>
  <p>I learned about GE recently. I implemented <a href="https://github.com/werediver/Sandbox" rel="nofollow noreferrer">a GP/GE system</a> to solve <a href="https://en.wikipedia.org/wiki/Santa_Fe_Trail_problem" rel="nofollow noreferrer">the Santa Fe Trail problem</a>. I chose not to perform wrapping to make genotype-to-phenotype mapping more predictable (I always generate enough codons to complete a grammar expansion, and prune unused tails). I also went with a subtree crossover, and a subtree-local mutation, which effectively make the system more a classical GP (with a fancy genotype-to-phenotype mapping) than GE. <strong>So there are some options</strong>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-26T14:18:35.683Z
Answers.LastActivityDate: 2020-12-27T14:26:38.640Z
Answers.LastEditDate: 2020-12-27T14:26:38.640Z
Answers.UserDisplayName: werediver
Body: <p>I've just started learning Grammatical Evolution and I'm reading the paper <a href="https://e098039d-a-62cb3a1a-s-sites.googlegroups.com/site/epscomputacionevolutiva/introduccion-a-la-programacion-automatica-evolutiva-evolucion-gramatical/grammatica_evolution_ieee_tec_2001.pdf?attachauth=ANoY7cp1rM9vbk-Cm-VUxPgX8XplxzM47859L5_Yj-F9tGdfKxfJFnqwcH2FZen6olXYuuAb0xBoKglZSuvGGcz7egrwOGeS1FixES3b1cpmhlKEm8cdgPp2P1umm6qcUfFJHwMvpybnfmSklvj0-3JAfaR1KY868iOln5iB3iUBjGP5EnBbnJsRdoXutpovtGhQxm8ZlToKmXXi7z7k95PRQGstABLy6KbDJNm8lWw_8tDxJsRsSa_Xav6N4jO0csNvhG8Vib45Oh8DvGKjurmyB-aS5D-BiRFuhX3Fdz_jHl5QIVXrHsH605WoIc10lhYxcJbCmNoYscl64cm5UKVHD3GcygrPntpJakrliiYb0GOb1WswY64%3D&amp;attredirects=1" rel="nofollow noreferrer">Grammatical Evolution</a> by Michael O'Neill and Conor Ryan.</p>
  <p>On page 3 (section IV-A), they write:</p>
  <blockquote>
  <p>During the genotype-to-phenotype mapping process it is possible for individuals to run out of codons and in this case, we wrap the individual and reuse the codons.</p>
  </blockquote>
  <p>I'm not an English native speaker and I don't understand the meaning of the word &quot;wrap&quot; here. What does it mean?</p>
  <p>I understood that, if none of the symbols are terminals, we have to start from the beginning of the genotype again and replace the nonterminal symbols until we have only terminal symbols. But, if I'm correct, when do I have to stop? In the paper, they also talk about non-valid individuals.</p>
  
Tags: <terminology><papers><genetic-programming><grammatical-evolution><codon>
Title: What does "we wrap the individual and reuse the codons" mean in the paper "Grammatical Evolution" by Neill and Ryan?
UserDisplayName: VansFannel
ThreadText: # What does "we wrap the individual and reuse the codons" mean in the paper "Grammatical Evolution" by Neill and Ryan?
  
  (Asked by: username_0 on 2018-03-24)
  
  I've just started learning Grammatical Evolution and I'm reading the paper [Grammatical Evolution](https://e098039d-a-62cb3a1a-s-sites.googlegroups.com/site/epscomputacionevolutiva/introduccion-a-la-programacion-automatica-evolutiva-evolucion-gramatical/grammatica_evolution_ieee_tec_2001.pdf?attachauth=ANoY7cp1rM9vbk-Cm-VUxPgX8XplxzM47859L5_Yj-F9tGdfKxfJFnqwcH2FZen6olXYuuAb0xBoKglZSuvGGcz7egrwOGeS1FixES3b1cpmhlKEm8cdgPp2P1umm6qcUfFJHwMvpybnfmSklvj0-3JAfaR1KY868iOln5iB3iUBjGP5EnBbnJsRdoXutpovtGhQxm8ZlToKmXXi7z7k95PRQGstABLy6KbDJNm8lWw_8tDxJsRsSa_Xav6N4jO0csNvhG8Vib45Oh8DvGKjurmyB-aS5D-BiRFuhX3Fdz_jHl5QIVXrHsH605WoIc10lhYxcJbCmNoYscl64cm5UKVHD3GcygrPntpJakrliiYb0GOb1WswY64%3D&attredirects=1) by Michael O'Neill and Conor Ryan.
  
  On page 3 (section IV-A), they write:
  
  > During the genotype-to-phenotype mapping process it is possible for individuals to run out of codons and in this case, we wrap the individual and reuse the codons.
  
  I'm not an English native speaker and I don't understand the meaning of the word "wrap" here. What does it mean?
  
  I understood that, if none of the symbols are terminals, we have to start from the beginning of the genotype again and replace the nonterminal symbols until we have only terminal symbols. But, if I'm correct, when do I have to stop? In the paper, they also talk about non-valid individuals.
  
  **Tags:** terminology, papers, genetic-programming, grammatical-evolution, codon
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-05-26. Score: 4 | Accepted answer
  
  In GE, the genotype is a linear sequence of codons. By "wrapping" it, you make it a circular sequence that never ends. It allows you to build a bigger tree, while having only a few codons. Still, it is possible to find such a combination of a genotype and a grammar that defines an infinitely deep expansion — such combinations are hardly suited for practical purposes.
  
  I learned about GE recently. I implemented [a GP/GE system](https://github.com/werediver/Sandbox) to solve [the Santa Fe Trail problem](https://en.wikipedia.org/wiki/Santa_Fe_Trail_problem). I chose not to perform wrapping to make genotype-to-phenotype mapping more predictable (I always generate enough codons to complete a grammar expansion, and prune unused tails). I also went with a subtree crossover, and a subtree-local mutation, which effectively make the system more a classical GP (with a fancy genotype-to-phenotype mapping) than GE. **So there are some options**.
  
  
  ---
  
  