This repository contains code of my very frist genetic algorithm. In it, I am optimized a simple sine function contained within the code. The algorithm provides an interesting solution, because it always converges to two serparate numbers that are somewhat close to each other but not exactly close to the correct result. It is about 0.4 off. For the selection process I implemented a roulette selection wheel that randomly chose a number within it's range. The scores were accumulated on a basis analogous to their positions in the population. There are about 10 generations and I do believe the purely stochastic nature of the search renders it very difficult and unassuming in finding an appropriate solution.
Full disclosure--My RWS is wrong here I believe. This is a result of my infancy in developing these algorithms. I've worked on more problems and I'm 60% sure I'm not completely right about the RWS on this problem. For a better RWS, check out Chapter 3. Thank you
Credit-- Xinjue Yu, Mitsuo Gen. <chapter 2.> Introduction to Evolutionary Algorithms