gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] regress.pike uncertainty patch


From: Evan Daniel
Subject: [gnugo-devel] regress.pike uncertainty patch
Date: Sun, 23 May 2004 02:13:57 -0400
User-agent: Mozilla Thunderbird 0.5 (X11/20040306)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This patch adds uncertainty totals to regress.pike.  For any reg_genmove
command in the tst file, it now follows with a move_uncertainty command
and keeps a running total.

The major known issue is that the uncertainty commands in gnugo do not
take fuseki randomness into account.

This is my first attempt at writing pike code, so comments are certainly
welcome :)

Evan Daniel


- - uncertainty totals in regress.pike

Index: regression/regress.pike
===================================================================
RCS file: /cvsroot/gnugo/gnugo/regression/regress.pike,v
retrieving revision 1.8
diff -u -d -r1.8 regress.pike
- --- regression/regress.pike   31 Mar 2004 13:26:21 -0000      1.8
+++ regression/regress.pike     23 May 2004 06:06:18 -0000
@@ -66,6 +66,7 @@
   int connection_nodes;
   float time;
   float cputime;
+  float uncertainty;

   array(int) pass;
   array(int) fail;
@@ -78,6 +79,7 @@
     reading_nodes = 0;
     owl_nodes = 0;
     connection_nodes = 0;
+    uncertainty = 0.0;
     time = 0.0;
     pass = ({});
     fail = ({});
@@ -135,7 +137,7 @@
     int number;
     string answer;
     if (sscanf(s, "=%d %s", number, answer)) {
- -      if (number < 10000 || number > 10004) {
+      if (number < 10000 || number > 10005) {
        test_number = (int) number;
        string correct = correct_results[test_number];
        if (!correct) {
@@ -177,6 +179,8 @@
        current_testsuite->connection_nodes += (int) answer;
       else if (number == 10003)
        current_testsuite->cputime = (float) answer;
+      else if (number == 10005)
+       current_testsuite->uncertainty += (float) answer;
       else if (number == 10004)
        break;
     }
@@ -263,6 +267,7 @@
   int number;
   string answer;
   string expected;
+  string temp1, temp2;

   timebase = time();
   last_time = time(timebase);
@@ -287,6 +292,9 @@
       send("reset_owl_node_counter");
       send("reset_connection_node_counter");
       send(s);
+      if (sscanf(s, "%sreg_genmove%s", temp1, temp2)) {
+       send("10005 move_uncertainty");
+      }
       send("10000 get_reading_node_counter");
       send("10001 get_owl_node_counter");
       send("10002 get_connection_node_counter");
@@ -310,6 +318,7 @@
 {
   float total_time = 0.0;
   float total_cputime = 0.0;
+  float total_uncertainty = 0.0;
   int reading_nodes = 0;
   int owl_nodes = 0;
   int connection_nodes = 0;
@@ -319,6 +328,7 @@
   foreach (testsuites, Testsuite t) {
     total_time       += t->time;
     total_cputime    += t->cputime;
+    total_uncertainty += t->uncertainty;
     reading_nodes    += t->reading_nodes;
     owl_nodes        += t->owl_nodes;
     connection_nodes += t->connection_nodes;
@@ -328,6 +338,7 @@
   write("Total nodes: %d %d %d\n", reading_nodes, owl_nodes,
        connection_nodes);
   write("Total time: %.2f (%.2f)\n", total_cputime, total_time);
+  write("Total uncertainty: %.2f\n", total_uncertainty);
   if (number_unexpected_pass > 0)
     write("%d PASS\n", number_unexpected_pass);
   if (number_unexpected_fail > 0)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAsEEk0OcbTJFOafIRAoNtAJoDZjydJkP5BmiTg0LYRvPXEwMZ+QCbBds/
JLG0San24qXW7nRhDJBUMP8=
=uU/s
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]