I have written a game playing program for a competition, which relies on some 16 floating point "constants". Changing a constant can and will have dramatic impact on playing style and success rate.
I have also written a simple genetic algorithm to generate the optimal values for the constants. However the algorithm does not generate "optimal" constants.
The likely reasons:
- The algorithm has errors (for the time being rule this out!)
- The population is to small
- The mutate rate is to high
- The mate rate could be better
The algorithm goes like this:
- First the initial population is created
- Initial constants for each member are assigned (based on my bias multiplied with 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 draw both are cloned once
- The cloning mutates one gene if random() is less than mutate rate
- Mutation multiplies a random constant with a random factor between 0.75 and 1.25
- At fixed intervals, dependent on mate rate, the members are paired and genes are mixed
My current settings:
- Population: 40 (to low)
- Mutate rate 0.10 (10%)
- Mate rate 0.20 (every 5 generations)
What would be better values for population size, mutate rate and mate rate?
Guesses are welcome, exact values are not expected! Also, if you have insights with similar genetic algorithms, you will like to share, please do so.
P.S.: The game playing competition in question, if anyone is interested: http://ai-contest.com/