
Instead of a fitness function which most GA use to score each chromosome, I am going to use a tournament structure to select chromosomes for both survival and to reproduce. I'll need to automate this process because I really want to set a PC in the corner and let it run until it comes up with an answer. To facilitate this, I'll need to develop a specialized administration tool that will manage the tournaments and the rest of the aspects of GA. I can use UCI to communicate with two versions of the same engine but pass the ID of the unique set of weights they will use for their evaluations for each game and then manage the game until completion. Each engine will load the weights associated with that ID from a shared data store. Hopefully, it can run multiple games simultaneously without bogging down the CPU too much. Loosely, here is how I think the process will go:
- Create initial population or gene pool (64 total chromosomes)
- Create 1 exemplar (set to 860 reasonable guesses for weights)
- Create 63 random chromosomes (random weights)
- Create a tournament for all 64 current chromosomes (if scores are available then seed pairings)
- Each individual match between two chromosomes will consist of two games allowing both to play each color.
- Score each game as follows: 2 points for win, 1 point each for draw and 0 points for loss
- If match results in tie, choose a winner randomly
- All winners advance to next round (repeat a-d)
- Starting with round of 16, each pairing will also crossover to produce two children (mutations possible)
- Tournament will continue until final pairing results in winner
- If winner is not the exemplar and is only different from prior generation's winner by less than 1%, then exit evolution and declare ultimate winner
- Stop evolution if 100 or more generations have been processed
- Top 32 chromosomes automatically advance to the next generation
- Create sudden death matches between 32 initial losers/32 new children (from 2 above)
- Only one round is played and 32 losers are kicked out of the gene pool (whether they be new children or previous chromosomes)
- Any chromosome that has lived longer than 10 generations (except for final 16 from 2) will be replaced by a new, randomly generated chromosome
- Return to step 2 and repeat.
If you have any experience (or even no experience) with genetic algorithms I would welcome your feedback. If everything runs as hoped each generation will consist of 256 games in the tournament followed by 64 games in sudden death. At 5-10 seconds allocated per games that will result in 25 - 55 minutes per generation. If it runs 100 generations without finding convergence that could take 100 hours of processing.