-
Notifications
You must be signed in to change notification settings - Fork 43
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
Introduce ELO rating system #35
Conversation
The zobrist_clear() function only released memory for all entries, leaving the hash_table memory untouched. Add a new zobrist_destroy_table() function to properly free all allocated memory associated with the hash table.
8a5f32c
to
428277b
Compare
|
elo.c
Outdated
printf("---------------------------------------------------------\n"); | ||
|
||
for (int i = 0; i < 3; ++i) | ||
printf("%-10s | %-11.2f | %-10lld | %-10lld | %-10lld\n", agent_name[i], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo. %-11.2f
should be %-10.2f
I'm thinking maybe we should default to turning off the related output messages unless the output option is enabled during compilation? |
It sounds good, these messages are intended for debug purposes and will not need to be displayed most of the time. |
Makefile
Outdated
@@ -8,6 +8,9 @@ MCTS = mcts | |||
RL_CFLAGS := $(CFLAGS) -D USE_RL | |||
MCTS_CFLAGS := $(CFLAGS) -D USE_MCTS | |||
MCTS_LDFLAGS := $(LDFLAGS) -lm | |||
ELO = elo | |||
ELO_CFLAGS := $(CFLAGS) -lm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop -lm
from CFLAGS
.
elo.c
Outdated
|
||
const char *agent_name[] = {"Negamax", "MCTS", "RL"}; | ||
|
||
long long int win[] = {0, 0, 0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you declare these variables as static
?
Implement the ELO rating system [1] to evaluate the relative strengths of various agents based on their performance. The ELO rating system, commonly utilized in assessing the skill levels of chess players, offers a reliable method to gauge the competitive abilities of agents in our context. This addition enhances our ability to make informed decisions and comparisons within our system. Link: https://en.wikipedia.org/wiki/Elo_rating_system [1]
Since the RL agent logging messages is not directly related to introducing the ELO system, I will file another PR to address this. |
Thank @visitorckw for contributing! |
Implement the ELO rating system [1] to evaluate the relative strengths of various agents based on their performance. The ELO rating system, commonly utilized in assessing the skill levels of chess players, offers a reliable method to gauge the competitive abilities of agents in our context. This addition enhances our ability to make informed decisions and comparisons within our system.
Additionally, zobrist_destroy_table() function was added to free all allocated memory associated with the hash table to ensure the proper functioning of the ELO rating system.
Link: https://en.wikipedia.org/wiki/Elo_rating_system [1]