Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peer review: Suggestions for Improving Nim Game Algorithm #1

Open
marcocolangelo opened this issue Nov 22, 2023 · 0 comments
Open

Peer review: Suggestions for Improving Nim Game Algorithm #1

marcocolangelo opened this issue Nov 22, 2023 · 0 comments
Assignees
Labels
Lab 2 Lab 2 Peer Review Peer Review

Comments

@marcocolangelo
Copy link

You've written a well organized and commented code, here I'm going to report just a few tips:

  1. 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

  2. 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

  3. 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

@marcocolangelo marcocolangelo changed the title Suggestions for Improving Nim Game Algorithm Peer review: Suggestions for Improving Nim Game Algorithm Nov 22, 2023
@lucabubi lucabubi self-assigned this Nov 24, 2023
@lucabubi lucabubi added Peer Review Peer Review Lab 2 Lab 2 labels Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lab 2 Lab 2 Peer Review Peer Review
Projects
None yet
Development

No branches or pull requests

2 participants