From 0c099135c43e45d0cb46ec665901ca3c8834a701 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 21 Sep 2008 19:40:50 +0200 Subject: [PATCH] UCT tree_node_dump(): Show number of children for each node --- uct/tree.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uct/tree.c b/uct/tree.c index d7d60e0..3b4a6fb 100644 --- a/uct/tree.c +++ b/uct/tree.c @@ -60,7 +60,10 @@ static void tree_node_dump(struct tree *tree, struct tree_node *node, int l, int thres) { for (int i = 0; i < l; i++) fputc(' ', stderr); - fprintf(stderr, "[%s] %f (%d/%d playouts [prior %d/%d amaf %d/%d]; hints %x)\n", coord2sstr(node->coord, tree->board), node->u.value, node->u.wins, node->u.playouts, node->prior.wins, node->prior.playouts, node->amaf.wins, node->amaf.playouts, node->hints); + int children = 0; + for (struct tree_node *ni = node->children; ni; ni = ni->sibling) + children++; + fprintf(stderr, "[%s] %f (%d/%d playouts [prior %d/%d amaf %d/%d]; hints %x; %d children)\n", coord2sstr(node->coord, tree->board), node->u.value, node->u.wins, node->u.playouts, node->prior.wins, node->prior.playouts, node->amaf.wins, node->amaf.playouts, node->hints, children); /* Print nodes sorted by #playouts. */ -- 2.11.4.GIT