-
Notifications
You must be signed in to change notification settings - Fork 51
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
Opening book on blank board #10
Comments
The opening book class is read-only in normal usage. You can find an example of how to generate the internal TranspositionTable of the opening book in the function generate_opening_book() of generator.cpp. This generator is fed with lines containing position and score separated by a space. You simply have to send it a line with an empty position (actually 0 characters) followed by a space (delimiter) and its score. for example, if you want to assign score 1 to an empty position send it the line " 1" (note the initial space) The solver is returning 1 for the 7x6 board using the opening book I provided. When you say that the solver gives a zero score to an empty position, are you using a different board size or a different opening book that the one I provided? |
I'm using my own opening book created from generator.cpp, and feeding it to the solver. I renamed 7x6_small.book to 7x6.book which the solver expects it to be loaded as. The board size is at the standard 7x6. I did exactly what you suggested, and it still gave zeroes. I haven't modified any of the code if you're wondering, I just compiled it and ran it on Cygwin64 to experiment additional features you made to your solver. Text output from Cygwin64: TTC@TTCW7 /cygdrive/c/Users/TTC/Downloads/connect4-master/connect4-master TTC@TTCW7 /cygdrive/c/Users/TTC/Downloads/connect4-master/connect4-master 0 2 0 TTC@TTCW7 /cygdrive/c/Users/TTC/Downloads/connect4-master/connect4-master |
I just fixed the generator such that it directly generate a file named "7x6.book" Unfortunately, I am unable to reproduce your issue. I get the correct score 1 on the empty position using an opening book that only contains the empty position. Here are the 3 exact commands I made from this commit 754d3b8 $ make c4solver generator $ echo " 1" | ./generator $ echo "" | ./c4solver |
Run the opening book generator first. You then input some arbitrary score to the empty position within the generator and then press Enter. After that, type any two non-numeric characters with spaces in between the characters then press the Enter key to create the book. This will produce a zero score on the empty position while it does not when you input a position of played moves. Using your method above, the problem actually goes away! This is the consequence of me being more familiar with the Windows command prompt than the Unix terminal. However, I still think this minor oversight needs fixing to fulfill with others not so advanced with consoles. |
I now understand what happened, when you were typing "A A", the parsing of the position "A" identified that the first char is invalid and stopped parsing, leading to the empty position. I improved robustness of the generator against invalid input in my last commit: d7acbd6 You can now also stop the input of the generator with an empty line in addition to EOF |
Is there a way to assign a score from an empty position to the opening book? I couldn't find any ways to do it. The solver gives a zero score to it, but every other position is fine.
The text was updated successfully, but these errors were encountered: