RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/value_moves.c,v
retrieving revision 1.171
diff -u -p -r1.171 value_moves.c
|
|
|
|
| 2977 | 2977 | || (owl_move_reason_known(pos, aa) |
| 2978 | 2978 | && dragon[aa].status == CRITICAL) |
| 2979 | 2979 | || move_reason_known(pos, SEMEAI_MOVE, aa)) { |
| | 2980 | float excess_value; |
| | 2981 | int our_dragon = (color == worm[aa].color); |
| | 2982 | float dragon_ter_val = 2 * DRAGON2(aa).strategic_size; |
| | 2983 | |
| | 2984 | if ((our_dragon && defense_move_known(pos, aa) == WIN) |
| | 2985 | || (!our_dragon && attack_move_known(pos, aa) == WIN)) { |
| | 2986 | excess_value = dragon_ter_val - move[pos].territorial_value; |
| | 2987 | if (excess_value > 0.0) { |
| | 2988 | /* We haven't counted all the territorial value, the most probably |
| | 2989 | * because of ko situations - repair it here. |
| | 2990 | * FIXME: We should count values of all ko threats to know how |
| | 2991 | * much we really gain. As for now 0.75 factor is used. */ |
| | 2992 | excess_value *= 0.75; |
| | 2993 | TRACE(" %1m: %f - territory underestimation bonus for %1m\n", pos, |
| | 2994 | excess_value, aa); |
| | 2995 | tot_value += excess_value; |
| | 2996 | } |
| | 2997 | } |
| | 2998 | |
| 2980 | 2999 | /* But if the strategical value was larger than the territorial |
| 2981 | 3000 | * value (e.g. because connecting to strong dragon) we award the |
| 2982 | 3001 | * excess value as a bonus. |
| 2983 | 3002 | */ |
| 2984 | | float excess_value = (dragon_value[aa] - |
| 2985 | | 2 * DRAGON2(aa).strategic_size); |
| | 3003 | excess_value = (dragon_value[aa] - dragon_ter_val); |
| 2986 | 3004 | if (excess_value > 0.0) { |
| 2987 | 3005 | TRACE(" %1m: %f - strategic bonus for %1m\n", pos, excess_value, aa); |
| 2988 | 3006 | tot_value += excess_value; |
RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/worm.c,v
retrieving revision 1.74
diff -u -p -r1.74 worm.c
|
|
|
|
| 1706 | 1706 | } |
| 1707 | 1707 | |
| 1708 | 1708 | |
| | 1709 | /* Find stones, that could live for sure, if player (color) moves |
| | 1710 | * first. |
| | 1711 | */ |
| | 1712 | |
| 1709 | 1713 | void |
| 1710 | 1714 | get_lively_stones(int color, signed char safe_stones[BOARDMAX]) |
| 1711 | 1715 | { |
| … |
… |
|
| 1713 | 1717 | memset(safe_stones, 0, BOARDMAX * sizeof(*safe_stones)); |
| 1714 | 1718 | for (pos = BOARDMIN; pos < BOARDMAX; pos++) |
| 1715 | 1719 | if (IS_STONE(board[pos]) && find_origin(pos) == pos) { |
| 1716 | | if ((stackp == 0 && worm[pos].attack_codes[0] == 0) || !attack(pos, NULL) |
| | 1720 | if ((stackp == 0 && worm[pos].attack_codes[0] == 0) |
| | 1721 | || !attack(pos, NULL) |
| 1717 | 1722 | || (board[pos] == color |
| 1718 | | && ((stackp == 0 && worm[pos].defense_codes[0] != 0) |
| 1719 | | || find_defense(pos, NULL)))) |
| | 1723 | && ((stackp == 0 && worm[pos].defense_codes[0] == WIN) |
| | 1724 | || find_defense(pos, NULL) == WIN))) |
| 1720 | 1725 | mark_string(pos, safe_stones, 1); |
| 1721 | 1726 | } |
| 1722 | 1727 | } |