You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You've written a well organized and commented code, here I'm going to report just a few tips:
In the crossover function you're dividing by the total fitness to calculate the parents' weights. What happens if the total fitness is zero? This could cause a division by zero error. It might be helpful to add a check for this case
As the professor suggested, maybe a fitness function only based on winning percentage is not the best option but at least you make your actors play for 1000 games before computing your fitness, this should improve your fitness space variety
your code is generally well commented but there are some parts (like the logic behind choosing valid moves in the adaptive_strategy function) that could benefit from more detailed comments
The text was updated successfully, but these errors were encountered:
marcocolangelo
changed the title
Suggestions for Improving Nim Game Algorithm
Peer review: Suggestions for Improving Nim Game Algorithm
Nov 22, 2023
You've written a well organized and commented code, here I'm going to report just a few tips:
In the
crossover
function you're dividing by the total fitness to calculate the parents' weights. What happens if the total fitness is zero? This could cause a division by zero error. It might be helpful to add a check for this caseAs the professor suggested, maybe a
fitness
function only based on winning percentage is not the best option but at least you make your actors play for 1000 games before computing your fitness, this should improve your fitness space varietyyour code is generally well commented but there are some parts (like the logic behind choosing valid moves in the
adaptive_strategy
function) that could benefit from more detailed commentsThe text was updated successfully, but these errors were encountered: