From 2fb32b94b848cf5aa2085ede6f5e5237b2ccd32c Mon Sep 17 00:00:00 2001 From: Jean-loup Gailly Date: Wed, 20 Jul 2011 00:19:53 +0200 Subject: [PATCH] UCT: think at least one second before early break This is necessary at least in distributed mode where 5000 playouts can be obtained in far less than 100ms. One tournament game was lost because of this. --- uct/search.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/uct/search.c b/uct/search.c index f974494..091fc33 100644 --- a/uct/search.c +++ b/uct/search.c @@ -42,6 +42,9 @@ static const struct time_info default_ti = { /* Minimal number of simulations to consider early break. */ #define PLAYOUT_EARLY_BREAK_MIN 5000 +/* Minimal time to consider early break (in seconds). */ +#define TIME_EARLY_BREAK_MIN 1.0 + /* Pachi threading structure: * @@ -308,6 +311,7 @@ uct_search_stop_early(struct uct *u, struct tree *t, struct board *b, /* Early break in won situation. */ if (best->u.playouts >= PLAYOUT_EARLY_BREAK_MIN + && (ti->dim != TD_WALLTIME || elapsed > TIME_EARLY_BREAK_MIN) && tree_node_get_value(t, 1, best->u.value) >= u->sure_win_threshold) { return true; } -- 2.11.4.GIT