Genetic algorithm fitness function
I haven't looked at your code, but a few observations.


Your selection method is very strong. If you generate 500 individuals at random and choose the best 100, within just a few generations you're going to have a population dominated by descendants of that initial 100 winners. In effect, you're very quickly focusing your search on the best 20% of a random sample. You probably need something like tournament or rank-biased selection instead -- something dramatically weaker than what you have.
The elite count is maybe a tad high as well. 5 might be OK, but certainly combined with your selection method, you have an algorithm that's basically designed to converge too quickly.
Averaging in crossover may or may not be harmful. It depends on where the optimal values of your parameters lie. Take a problem like "minimize f(x)=x^2 for x in [0, 100]". The optimal value of x in that problem is at 0, and averaging two parents will in this case always result in worse offspring than one of the parents you started with. For other problems, this may be helpful instead though. If you want to try something else, Simulated Binary Crossover (SBX) is often used for real-valued optimization problems. Alternately, one approach is to reduce the crossover rate and increase the mutation rate to provide a wider search of the parameter space.