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/
genetic-algorithm genetic-programming
Jan B. Kjeldsen
source share