Optimal population size, rate and rate of mutation transmission in the genetic algorithm

I wrote a competition game program that relies on some 16 floating point constants. Changing a constant can and will have a dramatic effect on the style of play and the speed of success.

I also wrote a simple genetic algorithm to create optimal values ​​for constants. However, the algorithm does not generate “optimal” constants.

Likely reasons:

  • The algorithm has errors (this is currently an exception!)
  • Population to small
  • Mutation Speed ​​- High
  • Transmission speed could be better

The algorithm is as follows:

  • First, an initial population is created.
  • Initial constants for each member are assigned (based on my offset multiplied by a random factor between 0.75 and 1.25).
  • For each generation, members of the population are paired for a game match
  • The winner is cloned twice if the rally of both is cloned once
  • Cloning mutates a single gene if random () is less than mutation rate
  • A mutation multiplies a random constant with a random coefficient between 0.75 and 1.25
  • At fixed intervals, depending on the rate of conjugation, members mate and genes mix.

My current settings:

  • Population: 40 (to low)
  • Mutation Speed ​​0.10 (10%)
  • Mate rate 0.20 (every 5 generations)

What are the best values ​​for population size, changes in speed and mating speed?

Guess welcome, exact values ​​are not expected! Also, if you have ideas with similar genetic algorithms that you enjoy, please do so.

PS: The competition in which the game participates, if someone is interested: http://ai-contest.com/

+7
genetic-algorithm genetic-programming
source share
2 answers

Your mutation size strikes me as surprisingly tall. There is also a little bias inherent in it - the larger the current value, the greater the mutation.

You can consider

  • Having (much!) Less mutation
  • Providing a fixed range mutation
  • The size distribution of mutations is different. you can use a normal distribution with an average of 1.

RA Fisher once compared the size of a mutation with the focusing of a microscope. If you change focus, you can go in the right direction or in the wrong direction. However, if you are close enough to the optimal one and turn it upside down, either you will go in the wrong direction or you will exceed the target. So finer tuning is usually better!

+2
source share

Use the GAUL circuit, it is very simple, so you can extract the target function to connect it to the GAUL. If you have a multi-core computer, then you will want to use omp (openMP) when compiling to parallelize your ratings (which I assume are runtimes). This way you can have a larger population. http://gaul.sourceforge.net/

Usually they use a high crossover and low mutation. Since you want creativity, I offer you high mutation and low crossover. http://games.slashdot.org/story/10/11/02/0211249/Developing-emStarCraft-2em-Build-Orders-With-Genetic-Algorithms?from=rss

Be very careful in your mutation function to stay in your cosmic search (inside 0.75, 1.25). Use a random GAUL function such as random_double (min, max). They are really well designed. Create your own mutation function. Make sure your parents die!

Then you can combine this with the simplex (Nelder-Mead) included in GAUL, because genetic programming with a low crossover will not find the optimal solution.

+2
source share

All Articles