giogenna16 / ComputationalIntelligence_2022_2023_s304684

0 stars 0 forks source link

Lab3 Review using Issues by Diego Gasco (s296762) #6

Open Diegomangasco opened 1 year ago

Diegomangasco commented 1 year ago

NIM GAME

Hi @giogenna16! I decided to examine your code about the creation of agents that can play Nim game. I tried locally your code and understood your purposes, I hope that my suggestions can be useful for you!

TASK 3.1

For the nim-sum agent, you implemented the strategy correctly and it looks the same as mine.

TASK 3.2

The Genetic Algorithm is very well implemented, I appreciated a lot the rules that you hardcoded. Choosing to use them, basing on the state of the match (number of plays already done), should be reasonable, but it make the GA strategy a bit more human-driven, same thing for deterministic strategies that avoid the randomness. These factors can be fine in order to running less time the "training phase" (let's call it the preparation phase for GA) than in a normal, more random-oriented, way. I suggest you to try also with parametrized strategies, where the parameters are randomly shuffled in order to find a reasonable way to beat against other agents. Also for "training phase" is good to set that a half of the games is started by one player and the other half by the other one, since some strategies depend on this fact.

TASK 3.3

The classical MinMax is the same as mine and also I have found some time issues. For this reason I decided to limit the depth of the tree in a static way (but I know that it brings to a sub-optimal solution), but you can also do it through a Monte Carlo approach. The alpha-beta pruning is very useful also for that reason, and your implementation of that was very significant for me in order to understand better the algorithm.

TASK 3.4

I saw in my implementation your same issue in games against random, the learning curve increases but with ups and downs, without reaching convergence. I think that is normal because, since the opponent makes random moves, some of them could be optimal or near the optimal for certain situations and in that cases the random strategy wins. I suggest you to not expand the tree for finding all possible states, this can be time expansive. I start the game with an empty dictionary of states and I add new ones or update them if present, through the game.

GENERAL STUFFS

I appreciated a lot your clearness in the README file and in your comments in the code, they are very useful to quick understand your mind flow ;) You add also the possibility for the user to play against an agent, this can improve a lot the user interaction with the system!
You can add to the README file the results for each strategy, I know that they are saved on the notebooks, but also in the README they can be appreciated.

CONCLUSION

It is clear that you worked a lot for this laboratory and the results that you reached are proof of this! Very good job ;)

giogenna16 commented 1 year ago

Thank you very much for the review!