Ticket #95: arend_7_9.14.diff

File arend_7_9.14.diff, 1.7 KB (added by arend, 6 years ago)
  • engine/influence.c

    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 
    971971  if (q->is_territorial_influence) 
    972972    add_marked_intrusions(q); 
    973973 
    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. 
    976976   */ 
    977977  for (ii = BOARDMIN; ii < BOARDMAX; ii++) 
    978     if (ON_BOARD(ii) && q->safe[ii]) { 
     978    if (ON_BOARD(ii) && !q->safe[ii]) { 
    979979      int k; 
     980      float black_reduction = 1.0; 
     981      float white_reduction = 1.0; 
    980982      for (k = 0; k < 8; k++) { 
    981983        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]) { 
    983985          /* Reduce less diagonally. */ 
    984986          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; 
    987989          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; 
    989997        } 
    990998      } 
     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; 
    9911003    } 
    9921004 
    9931005  reset_unblocked_blocks(q);