Calvin Hayes
March 8, 2006
Period 5
Notes
This source code runs 100 iterations of the completed genetic algorithm. Now, instead of simply playing games for each heuristic, or set of weights, and measuring the results, the machine is changing these weights after each iteration using the results. A slate of 12 'players' is initialized, each with a current state of 20 weights, one for each heuristic function over each of four portions of the game. Each iteration, three games are played against a random player for each 'player'. After all games have been played, the player with the lowest score is replaced by a new 'player', that is created as a combination of the the two best scoring 'players'. These high-scoring players are called 'parents' of this new 'child'. Mutations in the child are common but are restricted to 200 points in each heuristic.
This iteration has made a few major changes regarding the setup of the algorithm. The statistic used to rank players is now the average of the scores for all games played by the player. The only exception to this rule is that players who have played less than 15 games have their averages scaled back due to lack of capable information. Additionally, no players are exchanged for new ones until 5 iterations of games have been run. This gives an opportunity for the data to be converge for each player before the genetic process begins. Finally, the players themselves are no longer a combination of six weights. One function was removed, leaving five. These five functions now have a different weight in the player based on what time-stage of the game they are being evaluated in. That is, for the first 15 moves, the player would use the first group of five weights in evaluating each board position, but in moves 16-30, the player would use the second group of 5 weights.