Hi Federico!
First of all well done for the lab 2 about Nim, i really appreciate your code style, it was very clear to read and comprehend.
I find very good your definition of an agent by defining a class for it.
However i have some advice to improve your code:
I suggest to add more comments to your code to explain in more details your implementations, also with a short description in the README file
About the expert agent my advice is to enhance your current optimal strategy considering the game situation end up in a position with only one row of size 2 or more and at this point the nim sum is not equal to zero so the best move is to reduce this to a size of 0 or 1 and leaving an odd number of rows with size 1, from which all the moves are constrained. A possible implementation could be this one:
For the fitness function i would suggest to use also as measure the number of match won against the expert agent, maybe combining that to your current fitness implementation giving a different weight to each one and try different weights combination to find the best balance
You can also try to use recombination instead of only mutation, combining them and use a parameter to choose each step which one to use
As final advice, before using the adaptive strategy against the expert agent ,you can make a test to try different parameter combination in order to identify the best ones
I hope that my suggestion will help you and good luck for the next labs!
Hi Federico! First of all well done for the lab 2 about Nim, i really appreciate your code style, it was very clear to read and comprehend. I find very good your definition of an agent by defining a class for it. However i have some advice to improve your code:
I suggest to add more comments to your code to explain in more details your implementations, also with a short description in the README file
About the expert agent my advice is to enhance your current optimal strategy considering the game situation end up in a position with only one row of size 2 or more and at this point the nim sum is not equal to zero so the best move is to reduce this to a size of 0 or 1 and leaving an odd number of rows with size 1, from which all the moves are constrained. A possible implementation could be this one:
For the fitness function i would suggest to use also as measure the number of match won against the expert agent, maybe combining that to your current fitness implementation giving a different weight to each one and try different weights combination to find the best balance
You can also try to use recombination instead of only mutation, combining them and use a parameter to choose each step which one to use
As final advice, before using the adaptive strategy against the expert agent ,you can make a test to try different parameter combination in order to identify the best ones
I hope that my suggestion will help you and good luck for the next labs!