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

elo calculation, competition mode for comparing AI #69

Merged
merged 14 commits into from
Apr 11, 2019
Merged

Conversation

Vadman97
Copy link
Owner

Partially implements #56 need way to compare evaluation functions, currently just AI

Allows a way to empirically compare AI and in the future evaluation functions.

Cleaning up code to make printing disableable in both game and AI logic

Adding some tests.

@Vadman97 Vadman97 added the ai label Apr 11, 2019
@Vadman97 Vadman97 added this to the Ready for Demo milestone Apr 11, 2019
Optimize IsInCheckmate IsStalemate according to #67.
This improves performance noticeably
@codecov
Copy link

codecov bot commented Apr 11, 2019

Codecov Report

Merging #69 into master will increase coverage by 2.14%.
The diff coverage is 75%.

@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
+ Coverage   65.04%   67.18%   +2.14%     
==========================================
  Files          21       25       +4     
  Lines        1359     1533     +174     
==========================================
+ Hits          884     1030     +146     
- Misses        442      468      +26     
- Partials       33       35       +2

add penalty for repeating moves via the 50-moves-rule counter
@Vadman97 Vadman97 marked this pull request as ready for review April 11, 2019 04:37
@Vadman97
Copy link
Owner Author

pretty big PR - various framework for comparing AI. Need to make it so we can compare different versions of evaluation function, as well as record ELO for benchmark AI that we play against

Copy link
Collaborator

@gparanjape gparanjape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elo math looks good.
+1 for elo, didn't review the other stuff LOL.

I'm contributing!

@Vadman97
Copy link
Owner Author

Vadman97 commented Apr 11, 2019

thanks @gparanjape 👍

Copy link
Collaborator

@dadhia dadhia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see how the onlyFirstMove bool is passed on to getAllMoves() from getAllMovesCached() and this seems like the appropriate approach to optimization, but I do not see it being passed on to each piece. Ideally, we would just check one piece and see if we can move it. This would be very fast.
@Vadman97, Do you plan on implementing each piece separately in a different PR?
I don't necessarily like that we use a boolean, I would prefer to use a function with a different name but I realize this will require a lot of copy and pasting since the logic is quite similar (just an early return instead of building a list). I think boolean is fine.

pkg/chessai/board/game_board.go Show resolved Hide resolved
@Vadman97 Vadman97 requested a review from dadhia April 11, 2019 06:34
Copy link
Collaborator

@dadhia dadhia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice optimization. LGTM

@dadhia dadhia merged commit 684a7e1 into master Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants