[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] arend_1_30.3: additional ko value
From: |
Arend Bayer |
Subject: |
[gnugo-devel] arend_1_30.3: additional ko value |
Date: |
Fri, 29 Mar 2002 02:52:47 +0100 (CET) |
- ko threat value computation changed
It seems to me that the old computation of move[pos].additional_ko_value
in value_moves.c is flawed. If a move has reverse_followup_value, but
no followup value, then it got previously awarded a threat value.
This patch changes this. It did not change any regression, so this
was apparently not an urgent problem, although I vaguely remember seeing
it somewhere a few releases ago.
Arend
Index: engine/value_moves.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.22
diff -u -r1.22 value_moves.c
--- engine/value_moves.c 26 Mar 2002 21:32:59 -0000 1.22
+++ engine/value_moves.c 29 Mar 2002 01:41:41 -0000
@@ -2218,14 +2218,13 @@
move[pos].reverse_followup_value);
}
- /* If a ko fight is going on, we should use the full followup
- * and reverse followup values in the total value. We save the
- * additional contribution for later access.
+ /* If a ko fight is going on, we count sente moves with their
+ * full value. We save the additional contribution for later access.
*/
move[pos].additional_ko_value =
- followup_value
- + move[pos].reverse_followup_value
- - (tot_value - old_tot_value);
+ gg_min(0.5 * followup_value + 0.5 * move[pos].reverse_followup_value,
+ 1.0 * tot_value + followup_value)
+ - (tot_value - old_tot_value);
/* Not sure whether this could happen, but check for safety. */
if (move[pos].additional_ko_value < 0.0)
@@ -2233,8 +2232,9 @@
}
else {
move[pos].additional_ko_value =
- shape_factor * (move[pos].followup_value
- + move[pos].reverse_followup_value);
+ shape_factor * gg_min(0.5 * followup_value
+ + 0.5 * move[pos].reverse_followup_value,
+ followup_value);
}
tot_value += 0.05 * move[pos].secondary_value;
@@ -2273,9 +2273,9 @@
}
else {
move[pos].additional_ko_value =
- shape_factor * (move[pos].followup_value +
- gg_min(move[pos].followup_value,
- move[pos].reverse_followup_value));
+ shape_factor * gg_min(0.5 * move[pos].followup_value
+ + 0.5 * move[pos].reverse_followup_value,
+ move[pos].followup_value);
}
/* If the move is valued 0 or small, but has followup values and is
- [gnugo-devel] arend_1_30.3: additional ko value,
Arend Bayer <=