From 0027537e6ac8da3e21399e2bff1ac240f1d6382e Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 7 Mar 2010 18:08:35 +0100 Subject: [PATCH] UCT: Do not resign if we give extra dynkomi --- uct/uct.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/uct/uct.c b/uct/uct.c index 1a1d929..19107b0 100644 --- a/uct/uct.c +++ b/uct/uct.c @@ -750,11 +750,14 @@ uct_genmove(struct engine *e, struct board *b, struct time_info *ti, enum stone tree_node_get_value(u->t, 1, best->u.value), best->u.playouts, u->t->root->u.playouts, u->t->root->u.playouts - base_playouts, played_games); - /* Do not resign if we're so short of time that evaluation of best move is completely - * unreliable, we might be winning actually. In this case best is almost random but - * still better than resign. */ - if (tree_node_get_value(u->t, 1, best->u.value) < u->resign_ratio && !is_pass(best->coord) - && best->u.playouts > GJ_MINGAMES) { + /* Do not resign if we're so short of time that evaluation of best + * move is completely unreliable, we might be winning actually. + * In this case best is almost random but still better than resign. + * Also do not resign if we are getting bad results while actually + * giving away extra komi points (dynkomi). */ + if (tree_node_get_value(u->t, 1, best->u.value) < u->resign_ratio + && !is_pass(best->coord) && best->u.playouts > GJ_MINGAMES + && u->t->extra_komi <= 1 /* XXX we assume dynamic komi == we are black */) { reset_state(u); return coord_copy(resign); } -- 2.11.4.GIT