View source: R/parse_gamelog.R
parse_gamelog | R Documentation |
evaluate_game()
outputThe evaluate_game()
function produces a list of engine output for each
position of a chess game. This output tends to be dense, and much of it
will be of no interest to someone analyzing a game. The parse_gamelog()
function can extract the parts of interest into a more manageable format.
parse_gamelog(gamelog, target, depth = NULL)
gamelog |
A list of engine output from rbitr's |
target |
A single-element character vector of the output to return. Allowed values are 'score' for the evaluation in centipawns, 'pv' for the principal variation, or 'bestmove' for the best move. |
depth |
(Optional, default = NULL) A single-element integer vector indicating which search depth to return. The value must not be less than 1 or greater than the maximum depth reported by the engine. A value of NULL returns data for the maximum available depth. |
Use the target
parameter to specify what parse_gamelog()
should
return: positional evaluations in centipawns (score), principal variations
(pv), or best moves (bestmove).
The data for the deepest available search depth is returned by
default. To extract data for shallower depths, set the depth
parameter to the desired depth. Note that if evaluate_game()
was run
using fixed nodes or fixed time, the deepest search depth will vary across
different positions. If depth
is set to a value higher than what is
available for some moves, evaluate_game()
will return an error.
See the UCI protocol for details of UCI engine output.
A list of character vectors of the extracted data, where each list entry corresponds to a position.
The 'tabulate' functions tabulate analysis logs into data frames.
tabulate_positionlog()
for condensing analysis of one position.
tabulate_gamelog()
for condensing analysis of one game.
tabulate_pgnlog()
for condensing analysis of an entire pgn file.
The 'parse' functions extract specific data from analysis logs.
parse_gamelog()
for extracting data from one evaluated game.
parse_pgnlog()
for extracting data from games in a pgn.
The 'evaluate' functions produce analysis logs.
evaluate_position()
for analyzing chess positions.
evaluate_game()
for analyzing individual games.
evaluate_pgn()
for evaluating all the games in a PGN file.
gamelog <- list(c(
"Stockfish 13 by the Stockfish developers (see AUTHORS file)",
"readyok",
"info string NNUE evaluation using nn-62ef826d1a6d.nnue enabled",
"info depth 1 seldepth 1 multipv 1 score cp 146 nodes 30 nps 30000 tbhits 0 time 1 pv d2d4",
"bestmove d2d4"
))
parse_gamelog(gamelog, 'score')
parse_gamelog(gamelog, 'pv')
parse_gamelog(gamelog, 'bestmove')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.