From ab95a3783d49161cccce22f42ae4d48f58f31154 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 12 Aug 2012 16:56:28 +0200 Subject: [PATCH] Change default time settings from -t =80000 to -t 15 This loses a semi-nice property that Pachi will by default have the same strength on any computer, but on the other hand it will make Pachi adjust its strength based on the computer without playing needlessly fast or taking way too long time per move. This should be more user friendly. Suggested by Jean-Loup. --- README | 12 +++++------- uct/search.c | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README b/README index 88b8086..75426cb 100644 --- a/README +++ b/README @@ -52,16 +52,14 @@ How to run ~~~~~~~~~~ By default, Pachi will run on a single CPU core, taking up to 1.4GiB -of memory and taking completely arbitrary amount of time per turn. -You can adjust these parameters by passing it extra command -line options: +of memory and taking a little under 15 seconds per move. You can +adjust these parameters by passing it extra command line options: ./pachi -t _1200 threads=8,max_tree_size=3072 -This will make Pachi play with time settings 20:00 S.D. (unless it -gets told otherwise over GTP), with 8 threads, taking up to 3GiB -of memory (+ several tens MiB as a constant overhead) and thinking -during the opponent's turn as well. +This will make Pachi play with time settings 20:00 S.D. with 8 threads, +taking up to 3GiB of memory (+ several tens MiB as a constant overhead) +and thinking during the opponent's turn as well. Pachi can use an opening book in a Fuego-compatible format - you can obtain one at http://gnugo.baduk.org/fuegoob.htm and use it in Pachi diff --git a/uct/search.c b/uct/search.c index 054b270..ff363f1 100644 --- a/uct/search.c +++ b/uct/search.c @@ -22,14 +22,13 @@ #include "uct/walk.h" -/* Default number of simulations to perform per move. - * Note that this is now in total over all threads!. */ -#define MC_GAMES 80000 -static const struct time_info default_ti = { - .period = TT_MOVE, - .dim = TD_GAMES, - .len = { .games = MC_GAMES }, -}; +/* Default time settings for the UCT engine. */ +static struct time_info default_ti; +static __attribute__((constructor)) void +default_ti_init(void) +{ + time_parse(&default_ti, "15"); +} /* When terminating UCT search early, the safety margin to add to the * remaining playout number estimate when deciding whether the result can @@ -194,7 +193,10 @@ uct_search_start(struct uct *u, struct board *b, enum stone color, s->fullmem = false; if (ti) { - if (ti->period == TT_NULL) *ti = default_ti; + if (ti->period == TT_NULL) { + *ti = default_ti; + time_start_timer(ti); + } time_stop_conditions(ti, b, u->fuseki_end, u->yose_start, u->max_maintime_ratio, &s->stop); } -- 2.11.4.GIT