Genetic algorithms in cpp | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

Genetic algorithms in cpp

How can describe this to me ??I will give a present But remember that u should have understandable examples too

24th Jan 2020, 11:25 AM
Night Fury🔥<adrina>
Night Fury🔥<adrina> - avatar
6 Answers
+ 7
A genetic algorithm eh? My favorite! I don't use cpp though. I use Python for this, but any turing complete language can do this. First you must decide on a task that's fast to run and easy to score. How about printing hello world! Then you generate a large list of other lists containing letters. We'll call these creatures. You test each creature to see how close it is to "hello world", assigning a score. Then we take the top preformers, and overwrite (aka killing the underpreforming creatures, and birthing copies of the best), with some minor random letter changes with each birth. Repeat! Assuming you coded it right, the creatures will evolve into hello world. Congrats, that is a very simple genetic algorithm. You can go a lot farther with it via more complex tasks, parent breeding, genetic programming, tournament selection, and so much more! GL!
25th Jan 2020, 7:31 AM
Ahri Fox
Ahri Fox - avatar
+ 7
This documentation might be helpful to you: http://www.icce.rug.nl/documents/cplusplus/cplusplus19.html
24th Jan 2020, 11:39 AM
Vinay_GB
Vinay_GB - avatar
24th Jan 2020, 11:41 AM
Night Fury🔥<adrina>
Night Fury🔥<adrina> - avatar
+ 5
Ahri Fox Yeah !! Tnx for that
25th Jan 2020, 11:56 AM
Night Fury🔥<adrina>
Night Fury🔥<adrina> - avatar
+ 4
Hardik Pandya 👍👍👍👍👍🙌🙌
24th Jan 2020, 11:35 AM
Night Fury🔥<adrina>
Night Fury🔥<adrina> - avatar