From eea0ea3cf5f7b8c0f90977aaa8540dafbda496a0 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 30 Sep 2009 23:23:49 +0200 Subject: [PATCH] UCT: Remove non-RAVE AMAF support; induces extra mess and overhead --- uct/policy/ucb1amaf.c | 9 --------- uct/tree.h | 6 ++---- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/uct/policy/ucb1amaf.c b/uct/policy/ucb1amaf.c index a71d262..0b5f3f8 100644 --- a/uct/policy/ucb1amaf.c +++ b/uct/policy/ucb1amaf.c @@ -201,8 +201,6 @@ ucb1amaf_update(struct uct_policy *p, struct tree *tree, struct tree_node *node, if (node->parent == NULL) assert(tree->root_color == stone_other(child_color)); - if (p->descend != ucb1_descend) - node->hints |= NODE_HINT_NOAMAF; /* Rave, different update function */ update_node(p, node, result); if (amaf_nakade(map->map[node->coord])) amaf_op(map->map[node->coord], -); @@ -240,8 +238,6 @@ ucb1amaf_update(struct uct_policy *p, struct tree *tree, struct tree_node *node, * to record the result unmodified; in that case, * we will correctly negate them at the descend phase. */ - if (p->descend != ucb1_descend) - ni->hints |= NODE_HINT_NOAMAF; /* Rave, different update function */ update_node_amaf(p, ni, nres); #if 0 @@ -296,11 +292,6 @@ policy_ucb1amaf_init(struct uct *u, char *arg) b->urg_randoma = atoi(optval); } else if (!strcasecmp(optname, "urg_randomm") && optval) { b->urg_randomm = atoi(optval); - } else if (!strcasecmp(optname, "rave")) { - if (optval && *optval == '0') - p->descend = ucb1_descend; - else if (optval && *optval == 's') - p->descend = ucb1srave_descend; } else if (!strcasecmp(optname, "explore_p_rave") && optval) { b->explore_p_rave = atof(optval); } else if (!strcasecmp(optname, "equiv_rave") && optval) { diff --git a/uct/tree.h b/uct/tree.h index 5a11817..474b9f7 100644 --- a/uct/tree.h +++ b/uct/tree.h @@ -43,7 +43,6 @@ struct tree_node { struct move_stats amaf; /* Stats before starting playout; used for multi-thread normalization. */ struct move_stats pu, pamaf; -#define NODE_HINT_NOAMAF 0x80 int hints; }; @@ -93,9 +92,8 @@ tree_leaf_node(struct tree_node *node) static inline void tree_update_node_value(struct tree_node *node) { - bool noamaf = node->hints & NODE_HINT_NOAMAF; - node->u.value = (float)(node->u.wins + node->prior.wins + (!noamaf ? node->amaf.wins : 0)) - / (node->u.playouts + node->prior.playouts + (!noamaf ? node->amaf.playouts : 0)); + node->u.value = (float)(node->u.wins + node->prior.wins) + / (node->u.playouts + node->prior.playouts); } #endif -- 2.11.4.GIT