Genetical tuning
Posted: Tue Aug 11, 2015 2:34 pm
I've done some try with the genetical tuning of the evaluation function in Satana, some that gives only garbage someone interesting. First of all: starting from random values takes too many time and gives no efficient result. The next try was to start from one half of the population with hand typed values, those that already works almost well. This second test seems to gives valid and interesting results (i?ve changed the algorithm itself too).
The actual algorithm, after 15 iterations, shows that the values that I've wrote are almost the best but of 3. The interesting part is that those 3 parameters are all related to rook (in 7th rank, on open column and so on) and this could means that the algorithm has found that rook positioning was the wrong part of my evaluation.
The actual code for the genetic algorithm does this:
The actual algorithm, after 15 iterations, shows that the values that I've wrote are almost the best but of 3. The interesting part is that those 3 parameters are all related to rook (in 7th rank, on open column and so on) and this could means that the algorithm has found that rook positioning was the wrong part of my evaluation.
The actual code for the genetic algorithm does this:
Code: Select all
* at start
- creates N players
- assigns standard value to N/2 players, random values to the other
* play a match between any couple of players
- add 1 to the score of the winning player
- add -1 to loser
- 0 if draw
* at the end of any match:
- genetically cross N/4 players with another random player, but the last one
- set random values to the last player
- cross the last player with the first one
- cross the last player with another random one
(cross means assigning first (or last) random parameters of player b to player a)