Java Jenetics lib. Fitness progress stops in the first few generations

56 views Asked by At

I am trying to solve a problem using a genetic algorithm:

  • A gene stores ints approximately in the range of 0 to 500.
  • The size of one genotype is approximately in the range of 10 to 10000.
  • This genotype looks like: [13, 476, 3, 89...]
  • The population of one generation is 100.
  • The number of generations is 10000.
  • I made a fitness function. It gives a score in the range of 0 to 1 (type double).

First try

I wrote my genetic algorithm. I wrote it as simply as possible, because I was not sure that it would work at all.

With these parameters, it gives a result of approximately 0.91 fitness. This is a good result, but I'm sure that I can achieve a result of at least 0.97 fitness. But my algorithm is starting to lose performance. He continues to improve the result, but the progress of this improvement is extremely slow.

Second try

I decided to try something different. Using my fitness function I implemented Jenetics library with all by default and population = 100. The genotype is the same as in the first case.

10000 generations gave a result of about 0.27 fitness. At the same time, the fitness of the first generation is approximately 0.20-0.23. And he reaches the result of 0.27 fitness in about 100 generations, after which progress stops.

Question

Why? All parameters are by default, I did not change anything at all (except for the population size). What have I done wrong? Please explain and tell me what parameters should be given to this library. I'm not very good at genetic algorithms.

The problem is that progress is not moving at all. In my algorithm, it moves, slowly but surely.

I tried changing offspringSelector(). I tried different ones with different values. In my algorithm, I use something similar to EliteSelector(1). I tried changing alterers(). Here too I have tried various combinations of classes with different values. In my algorithm, I use something similar to SinglePointCrossover(1) + Mutator(0.1).

I have no need to repeat my algorithm. I want to achieve a similar result using the Jenetics implementation. Or at least for fitness to just start growing, and not stop at the very beginning.

0

There are 0 answers