From 04596b45623b753bd046fc6f211a73142556f559 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 9 Mar 2013 01:06:33 +0100 Subject: [PATCH] Moggy mq_tagged_choose: Debug print with probability distribution --- playout/moggy.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/playout/moggy.c b/playout/moggy.c index 803523d..16ecb02 100644 --- a/playout/moggy.c +++ b/playout/moggy.c @@ -596,6 +596,13 @@ mq_tagged_choose(struct playout_policy *p, struct board *b, enum stone to_play, /* Finally, pick a move! */ fixp_t stab = fast_irandom(total); + if (PLDEBUGL(5)) { + fprintf(stderr, "Pick (total %.3f stab %.3f): ", fixp_to_double(total), fixp_to_double(stab)); + for (unsigned int i = 0; i < q->moves; i++) { + fprintf(stderr, "%s(%x:%.3f) ", coord2sstr(q->move[i], b), q->tag[i], fixp_to_double(pd[i])); + } + fprintf(stderr, "\n"); + } for (unsigned int i = 0; i < q->moves; i++) { //fprintf(stderr, "%s(%x) %f (%f/%f)\n", coord2sstr(q->move[i], b), q->tag[i], fixp_to_double(stab), fixp_to_double(pd[i]), fixp_to_double(total)); if (stab < pd[i]) -- 2.11.4.GIT