UCT virtual_loss: Allow setting virtual_loss to arbitrary values
authorPetr Baudis <pasky@ucw.cz>
Sun, 12 Aug 2012 12:18:41 +0000 (12 14:18 +0200)
committerPetr Baudis <pasky@ucw.cz>
Sun, 12 Aug 2012 12:18:41 +0000 (12 14:18 +0200)
uct/uct.c

index d904640..c18cf06 100644 (file)
--- a/uct/uct.c
+++ b/uct/uct.c
@@ -824,9 +824,9 @@ uct_state_init(char *arg, struct board *b)
                                        fprintf(stderr, "UCT: Invalid thread model %s\n", optval);
                                        exit(1);
                                }
-                       } else if (!strcasecmp(optname, "virtual_loss")) {
+                       } else if (!strcasecmp(optname, "virtual_loss") && optval) {
                                /* Number of virtual losses added before evaluating a node. */
-                               u->virtual_loss = !optval || atoi(optval);
+                               u->virtual_loss = atoi(optval);
                        } else if (!strcasecmp(optname, "pondering")) {
                                /* Keep searching even during opponent's turn. */
                                u->pondering_opt = !optval || atoi(optval);