RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/influence.c,v
retrieving revision 1.116
diff -u -p -r1.116 influence.c
|
|
|
find_influence_patterns(struct influence |
| 971 | 971 | if (q->is_territorial_influence) |
| 972 | 972 | add_marked_intrusions(q); |
| 973 | 973 | |
| 974 | | /* When color == EMPTY, we introduce a weaker kind of barriers |
| 975 | | * manually instead of searching for patterns. |
| | 974 | /* Additionally, we introduce a weaker kind of barriers around living |
| | 975 | * stones. |
| 976 | 976 | */ |
| 977 | 977 | for (ii = BOARDMIN; ii < BOARDMAX; ii++) |
| 978 | | if (ON_BOARD(ii) && q->safe[ii]) { |
| | 978 | if (ON_BOARD(ii) && !q->safe[ii]) { |
| 979 | 979 | int k; |
| | 980 | float black_reduction = 1.0; |
| | 981 | float white_reduction = 1.0; |
| 980 | 982 | for (k = 0; k < 8; k++) { |
| 981 | 983 | int d = delta[k]; |
| 982 | | if (ON_BOARD(ii + d) && !q->safe[ii + d]) { |
| | 984 | if (IS_STONE(board[ii + d]) && q->safe[ii + d]) { |
| 983 | 985 | /* Reduce less diagonally. */ |
| 984 | 986 | float reduction = (k < 4) ? 0.25 : 0.65; |
| 985 | | if (board[ii] == BLACK) |
| 986 | | q->white_permeability[ii + d] *= reduction; |
| | 987 | if (board[ii + d] == BLACK) |
| | 988 | white_reduction *= reduction; |
| 987 | 989 | else |
| 988 | | q->black_permeability[ii + d] *= reduction; |
| | 990 | black_reduction *= reduction; |
| | 991 | } |
| | 992 | else if (IS_STONE(board[ii + d]) && !q->safe[ii + d]) { |
| | 993 | if (board[ii + d] == BLACK) |
| | 994 | white_reduction = -100.0; |
| | 995 | else |
| | 996 | black_reduction = -100.0; |
| 989 | 997 | } |
| 990 | 998 | } |
| | 999 | if (black_reduction > 0.0) |
| | 1000 | q->black_permeability[ii] *= black_reduction; |
| | 1001 | if (white_reduction > 0.0) |
| | 1002 | q->white_permeability[ii] *= white_reduction; |
| 991 | 1003 | } |
| 992 | 1004 | |
| 993 | 1005 | reset_unblocked_blocks(q); |