SamiSani68 / CI2324

Computational Intelligence
0 stars 0 forks source link

Lab 2 peer review #2

Closed s320168 closed 11 months ago

s320168 commented 11 months ago

It seems to me that you considered as winner of the game the player who takes the last matchstick while the goal of the lab was to avoid taking the last one: this would mess up the fitness calculation and favor worse individuals over better ones inside the population.

In task 2.1 rule_based_nim_sum is most likely to lose because it only checks for nim-sum to be 0, so it will lose once there is only 1 row with 1 or more matchsticks. By adding a check on how many rows remain before choosing what to play it's possible to switch strategy to leave only 1 match (if initially there are 2 or more of them) to the next player, forcing them to lose when a game presents this setting.

In task 2.2 there shouldn't be any ranking before choosing mu parents as they should be chosen entirely randomly in ES. The bias computed in the evolved_strategy function isn't used to compute the player's move so there is no real evolution. The correct way to implement (mu+lambda)-ES is to select mu random parents to be kept from the previous population, use them to create lambda // mu children to be mutated and perform a survival of the fittest selection over all population, I'm not sure about the population size and parents amount every generation used in the code.

SamiSani68 commented 11 months ago

Thank you for your comprehensive review and valuable insights. I appreciate the feedback provided by your analysis, and I am committed to addressing the identified issues. Here are the planned adjustments:

  1. Victory Condition: I understand the importance of aligning the victory condition with the lab's goal, which is to avoid taking the last matchstick. I will correct the interpretation of the game results to ensure that the player who avoids taking the last matchstick is considered the winner in the fitness calculation. This correction will prioritise better individuals within the population.
  2. Rule-Based Nim-Sum Strategy: I acknowledge the observation regarding the limitations of the rule_based_nim_sum strategy. To enhance its effectiveness, I will modify the strategy to consider the number of remaining rows before making a move. This adjustment aims to better align the strategy with the goal of leaving only one matchstick for the next player in certain scenarios.
  3. Evolutionary Strategy Implementation: Your feedback on the (mu+lambda)-ES implementation is well-taken. I will revise the strategy to ensure that parents are randomly selected without ranking before creating offspring. Additionally, I will refine the computation and utilisation of the bias in the evolved_strategy function to facilitate a meaningful evolution of strategies. I appreciate your thorough review, and I'm open to any further recommendations or specific aspects you believe should be addressed. Your input is invaluable, and I'm dedicated to refining the code to meet the objectives of the lab. Thank you once again for your insights.