From 2eef5295f36abbb0bdea3932f9b6a3b8ad8837c5 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 19 Sep 2008 00:51:40 +0200 Subject: [PATCH] UCT: Reduce number of playouts if we already inherited many We could've read things out before either by getting promoted from previous tree, or from receiving the data from an opening book. This way, we should gradually read more during the game as the opening book branches trickle down. --- uct/uct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uct/uct.c b/uct/uct.c index 890f677..f1dc30e 100644 --- a/uct/uct.c +++ b/uct/uct.c @@ -189,7 +189,7 @@ promoted:; } int i; - for (i = 0; i < u->games; i++) { + for (i = 0; i < u->games - (u->t->root->u.playouts / 1.5); i++) { int result = uct_playout(u, b, color, u->t); if (result < 0) { /* Tree descent has hit invalid move. */ @@ -217,7 +217,7 @@ promoted:; return coord_copy(pass); } if (UDEBUGL(0)) - fprintf(stderr, "*** WINNER is %s (%d,%d) with score %1.4f (%d/%d games)\n", coord2sstr(best->coord, b), coord_x(best->coord, b), coord_y(best->coord, b), best->u.value, best->u.playouts, u->t->root->u.playouts); + fprintf(stderr, "*** WINNER is %s (%d,%d) with score %1.4f (%d/%d:%d games)\n", coord2sstr(best->coord, b), coord_x(best->coord, b), coord_y(best->coord, b), best->u.value, best->u.playouts, u->t->root->u.playouts, i); if (best->u.value < u->resign_ratio && !is_pass(best->coord)) { tree_done(u->t); u->t = NULL; return coord_copy(resign); -- 2.11.4.GIT