ludofiorio / labs_comp_inte

0 stars 0 forks source link

peer review lab2 by Matteo Martini s314786 #1

Open MatteMartini opened 7 months ago

MatteMartini commented 7 months ago

The provided code is organized and well understandable. For the Task 2.1 have been created 3 different agents (eliminate_one_row, eliminate_two_row, leave_one_elem_row) that remove a certain number of elements from the rows based on how many elements are left in that row. These strategies are then added to those already present to create a genome of strategies, and each is assigned a certain weight.

Changes to these weights are then made with small random modifications, not following a Gaussian distribution but with a randomly chosen value within a certain range. The adaptive method selects a move based on the current genome of the agent. It uses a probabilistic approach, where the probability of selecting a strategy is proportional to its weight in the genome.

I would like to give you some opinions about your code:

I found clever update the nim_sum function, first checking if the sum of the elements in the current configuration is an odd number. In that case, there is no need to perform the XOR because surely this will not be a safe configuration, given the '1' at the end of the number. Moreover, adding an extra print statement showing the move being made has helped in understanding the results.

A good idea to understand more the final results might be to add a print statement displaying the number of victories for various strategies and the final weights of the genome, in order to fully understand the effect of the self-adaptive strategy.

Additionally, I found unusual the use of offspring size equal to 1 in the application of evolutionary algorithms. In fact, the implementations of 1+λ and 1,λ strategies were required, with the use of Gaussian mutations.

I hope that my suggestion can help you