gtpstatistics
Prev | Appendix A. Reference | Next

## gtpstatistics

gtpstatistics — Runs GTP commands on all positions of game collections.

## Synopsis

`gtpstatistics` [`-backward`] [`-begin` `commands`] [`-config` `file`] [`-commands` `commands`] [`-final` `commands`] [`-force`] [`-min` `n`] [`-max` `n`] [`-program` `program`] [`-setup` `n`] [`-size` `n`] [`-verbose`] `file.sgf` ...

`gtpstatistics` [`-help`]

`gtpstatistics` [`-version`]

`gtpstatistics` [`-analyze` `file`] [`-config` `file`] [`-output` `file`] [`-precision` `n`]

## Description

Runs a a set of commands for a Go program supporting the Go Text Protocol on each position of Go game collections. The results are stored in the text file "gtpstatistics.dat" in table format. If gtpstatistics is run with the option `-analyze`, a HTML file is produced, which contains summary statistics for this file. Games must not contain setup stones.

For the following standard and commonly used commands, an automatic conversion of the result is done:

cputime

  The result is the difference to the last invocation of cputime.

estimate_score

  The result is parsed for a score string as the first word (like GNU Go's response) The score string is converted into a score number, Black counting positive, White negative.

final_score

  The result is parsed for a score string. The score string is converted into a score number, Black counting positive, White negative.

reg_genmove

  The color of the move in the game is appended. The result is "1", if the result is the same move as played in the game, "0" otherwise.

The return value of gtpstatistics is 0, if the run completed successfully, -1 otherwise.

## Options

`-analyze` `file`

  Analyze the result table ``file.dat``. Creates a HTML report files. The files will be placed in the same directory as ``file.dat`` and use ``file`` as a filename prefix.

`-backward`

  Iterate backward over positions, starting with end position as number one.

`-config` `file`

  Read command line options and arguments from file.

`-commands` `commands`

  Comma separated list of GTP commands to run on each position (before each move).

`-final` `commands`

  Comma separated list of GTP commands to run only on final positions (after the last move).

`-force`

  Overwrite existing result table.

`-help`

  Display help and exit.

`-max`

  Only run commands on positions at less or equal this move number.

`-min`

  Only run commands on positions at greater or equal this move number.

`-output` `file`

  Filename for result table. Default is `gtpstatistics.dat`. If option `-analyze` is used, the output is a directory or directory and file name prefix for the generated report files.

`-precision` `n`

  Maximum number of fraction digits for floating point numbers in output file.

`-program` `command`

  Command line for running Go program.

`-setup`

  Allow setup stones in the root position.

`-size` `n`

  Board size allowed for games (default 19).

`-verbose`

  Print the GTP stream to the Go program to standard error.

`-version`

  Print version and exit.

## Examples

### Run GtpStatistics

    gtpstatistics -program "gnugo --mode gtp" \
      -commands "reg_genmove,estimate_score,cputime" \
      -final "final_score" \
      regression/games/olympiad2004/19x19/*.sgf

### Generate HTML Reports

    gtpstatistics -analyze gtpstatistics.dat \
      -output statistics/olympiad2004

Prev | Up | Next
gtpserver | Home | gtpterminal