I am writing an app using genetic algorithm, where I use two the genes of an individual are real numbers (doubles, since I am writing it in Java). So I was wondering what would be the best way to do the recombination using real numbers and not bits.
I tried doing it this way:
If p1 = (x1, y1) and p2 = (x2, y2) were parents and r was some random number between 0 and 1, then I would get the children like this:
c1 = ( r*x1 + (1-r)*x2 , r*y1 + (1-r)*y2)
c2 = ((1-r)*x1 + r*x2 , (1-r)*y1 + r*y2 )
But I am not very satisfied with the result this solution gives me. It seems that the children are not always better than the parents, but they should be based on the main concept of genetic algorithm.
So I would be grateful if anyone could give me another idea or a hint.