/[gnugo]/gnugo/engine/influence.c
ViewVC logotype

Diff of /gnugo/engine/influence.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.51 by gf, Sun Apr 7 14:48:33 2002 UTC revision 1.52 by gf, Sun Apr 7 14:49:57 2002 UTC
# Line 338  accumulate_influence(struct influence_da Line 338  accumulate_influence(struct influence_da
338   * The name saved_stones is historic and should probably be changed   * The name saved_stones is historic and should probably be changed
339   * since it also includes captured stones.   * since it also includes captured stones.
340   *   *
  * The relative strength for inessential stones must be somewhat  
  * larger than 0. Otherwise they may be considered as territory for  
  * the opponent and the territory evaluations may mess up.  
341   */   */
342    
343  static float strength_map[10] = {  static float strength_map[10] = {
344    0.0,   /* DEAD            */    0.0,   /* DEAD            */
345    0.9,   /* ALIVE           */    0.9,   /* ALIVE           */
346    0.5,   /* CRITICAL        */    0.5,   /* CRITICAL        */
347    0.01,  /* INESSENTIAL     */    0.0,   /* INESSENTIAL     */
348    0.0,   /* TACTICALLY DEAD */    0.0,   /* TACTICALLY DEAD */
349    0.7,   /* WEAK            */    0.7,   /* WEAK            */
350    0.8,   /* WEAKLY_ALIVE    */    0.8,   /* WEAKLY_ALIVE    */
# Line 445  init_influence(struct influence_data *q, Line 442  init_influence(struct influence_data *q,
442          if (IS_STONE(board[pos])          if (IS_STONE(board[pos])
443              && dragons_known              && dragons_known
444              && dragon[pos].id != -1              && dragon[pos].id != -1
445              && DRAGON2(pos).safety == INESSENTIAL              && (DRAGON2(pos).safety == INESSENTIAL
446                    || (worm[pos].inessential
447                        && ((DRAGON2(pos).safety != DEAD
448                             && DRAGON2(pos).safety != CRITICAL)
449                            || (DRAGON2(pos).safety == CRITICAL
450                                && board[pos] == color))))
451              && q->p[i][j] == EMPTY)              && q->p[i][j] == EMPTY)
452            q->p[i][j] = board[pos];            q->p[i][j] = board[pos];
453        }        }
# Line 1279  new_value_territory(struct influence_dat Line 1281  new_value_territory(struct influence_dat
1281      for (j = 0; j < board_size; j++) {      for (j = 0; j < board_size; j++) {
1282        first_guess[i][j] = 0.0;        first_guess[i][j] = 0.0;
1283    
1284        if (q->p[i][j] == EMPTY        if (q->p[i][j] == EMPTY) {
           || (q->black_strength[i][j] == 0 && q->white_strength[i][j] == 0)) {  
1285          float diff = 0.0;          float diff = 0.0;
1286          if (q->white_influence[i][j] + q->black_influence[i][j] > 0)          if (q->white_influence[i][j] + q->black_influence[i][j] > 0)
1287            diff = (q->white_influence[i][j] - q->black_influence[i][j])            diff = (q->white_influence[i][j] - q->black_influence[i][j])
# Line 1318  new_value_territory(struct influence_dat Line 1319  new_value_territory(struct influence_dat
1319     */     */
1320    for (i = 0; i < board_size; i++)    for (i = 0; i < board_size; i++)
1321      for (j = 0; j < board_size; j++) {      for (j = 0; j < board_size; j++) {
1322        /* Do not overrule dead stone territory above. */        /* Do not overrule dead stone territory above.
1323           * FIXME: This does not do what it claims to do. Correcting it
1324           * seems to break some tests, though.
1325           */
1326        if (q->p[i][j] == EMPTY) {        if (q->p[i][j] == EMPTY) {
1327          /* Loop over all neighbors. */          /* Loop over all neighbors. */
1328          for (k = 0; k < 4; k++) {          for (k = 0; k < 4; k++) {
# Line 1355  new_value_territory(struct influence_dat Line 1359  new_value_territory(struct influence_dat
1359    /* Third loop: Nonterritory patterns, points for prisoners. */    /* Third loop: Nonterritory patterns, points for prisoners. */
1360    for (i = 0; i < board_size; i++)    for (i = 0; i < board_size; i++)
1361      for (j = 0; j < board_size; j++) {      for (j = 0; j < board_size; j++) {
1362        if (q->p[i][j] == EMPTY        if (q->p[i][j] == EMPTY) {
           || (q->black_strength[i][j] == 0 && q->white_strength[i][j] == 0)) {  
1363          /* If marked as non-territory for the color currently owning          /* If marked as non-territory for the color currently owning
1364           * it, reset the territory value.           * it, reset the territory value.
1365           */           */

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26