Reputation: 29886
Ive been trying to get a floating point fitness function working but the closer the organisms get to the target sequence, the longer it takes.
I have tried a few implementations but on each one, the crossover leads to each organism's gene sequence being the same, but the fitness is only around 50%
What is a good way to evaluate floating point sequence values between -1.0 and 1.0?
Upvotes: 0
Views: 103
Reputation: 2006
Premature convergence is one of the biggest problems with evolutionary computation. I'm not sure what kind of selection scheme you're using, but that's likely where you need to be focused.
If you're not using tournament-based selection, step one is to try that. A simple version is: For each member of the population in the next generation choose X organisms from the current population. Only the highest fitness one moves on. Repeat until the next population is full. If you use a low X (2 being the lowest) you have a weak selective pressure so that evolution takes longer BUT you may keep more diversity.
The nice thing about tournament selection is that the magnitude of fitness doesn't matter, only the order, which helps when you have populations that are almost even.
Assuming this first selection mechanism doesn't work, you need to use one that actively preserves diversity. Fitness sharing tends to be an effective option -- an individual solution's fitness gets modified based on how many identical (or similar organisms) there are out there. Basically keep a count of how many solutions of each type you have, how many neighbors, and use a simple function to modify fitness based on that (maybe -5% per identical copy, -1% per neighbor... there are MANY options).
There are also many more advanced techniques that you can try, but these should get you a long way.
Upvotes: 2