Ticket #173: lively_stones.patch

File lively_stones.patch, 3.9 kB (added by draqo, 17 months ago)
  • config.vc

    diff -N -r -u -X .ignore gnugo-copy/config.vc gnugo/config.vc
    old new  
    3030/* GAIN/LOSS codes. Disabled by default. */ 
    3131#define EXPERIMENTAL_OWL_EXT 0 
    3232 
     33/* Disable unneeded things. 0 standard. */ 
     34#define FINAL_RELEASE 0 
     35 
    3336/* Define as 1 to use the grid optimisation, or 2 to run it in self-test mode 
    3437   */ 
    3538#define GRID_OPT 1 
  • engine/value_moves.c

    diff -N -r -u -X .ignore gnugo-copy/engine/value_moves.c gnugo/engine/value_moves.c
    old new  
    29812981        || (owl_move_reason_known(pos, aa) 
    29822982            && dragon[aa].status == CRITICAL) 
    29832983        || move_reason_known(pos, SEMEAI_MOVE, aa)) { 
     2984      float excess_value; 
     2985      int our_dragon = (color == worm[aa].color); 
     2986      float dragon_ter_val = 2 * DRAGON2(aa).strategic_size; 
     2987 
     2988      if ((our_dragon && defense_move_known(pos, aa) == WIN) 
     2989          || (!our_dragon && attack_move_known(pos, aa) == WIN)) { 
     2990        excess_value = dragon_ter_val - move[pos].territorial_value; 
     2991        if (excess_value > 0.0) { 
     2992          /* We haven't counted all the territorial value, the most probably 
     2993           * because of ko situations - repair it here. 
     2994           * FIXME: We should count values of all ko threats to know how 
     2995           * much we really gain. As for now 0.75 factor is used. */ 
     2996          excess_value *= 0.75; 
     2997          TRACE("  %1m: %f - territory underestimation bonus for %1m\n", pos, 
     2998                excess_value, aa); 
     2999          tot_value += excess_value; 
     3000        } 
     3001      } 
     3002 
    29843003      /* But if the strategical value was larger than the territorial 
    29853004       * value (e.g. because connecting to strong dragon) we award the 
    29863005       * excess value as a bonus. 
    29873006       */ 
    2988       float excess_value = (dragon_value[aa] -  
    2989                             2 * DRAGON2(aa).strategic_size); 
     3007      excess_value = (dragon_value[aa] - dragon_ter_val); 
    29903008      if (excess_value > 0.0) { 
    29913009        TRACE("  %1m: %f - strategic bonus for %1m\n", pos, excess_value, aa); 
    29923010        tot_value += excess_value; 
  • engine/worm.c

    diff -N -r -u -X .ignore gnugo-copy/engine/worm.c gnugo/engine/worm.c
    old new  
    17341734} 
    17351735 
    17361736 
     1737/* Find stones, that could live for sure, if player (color) moves 
     1738 * first. 
     1739 */ 
     1740 
    17371741void 
    17381742get_lively_stones(int color, signed char safe_stones[BOARDMAX]) 
    17391743{ 
     
    17411745  memset(safe_stones, 0, BOARDMAX * sizeof(*safe_stones)); 
    17421746  for (pos = BOARDMIN; pos < BOARDMAX; pos++) 
    17431747    if (IS_STONE(board[pos]) && worm[pos].origin == pos) { 
    1744       if ((stackp == 0 && worm[pos].attack_codes[0] == 0) || !attack(pos, NULL) 
     1748      if ((!stackp && !worm[pos].attack_codes[0]) 
     1749          || (stackp && !attack(pos, NULL)) 
    17451750          || (board[pos] == color 
    1746               && ((stackp == 0 && worm[pos].defense_codes[0] != 0) 
    1747                   || find_defense(pos, NULL)))) 
     1751              && ((!stackp && worm[pos].defense_codes[0] == WIN) 
     1752                  || (stackp && find_defense(pos, NULL) == WIN)))) 
    17481753        mark_string(pos, safe_stones, 1); 
    17491754    } 
    17501755} 
  • regression/arb.tst

    diff -N -r -u -X .ignore gnugo-copy/regression/arb.tst gnugo/regression/arb.tst
    old new  
    6666# Defend against a combination attack. 
    6767loadsgf games/arb/game03.sgf 109 
    6868232 reg_genmove black 
    69 #? [M9|M10|L10|L11] 
     69#? [M9|M10|M11|L10|L11] 
    7070 
    7171loadsgf games/arb/game04.sgf 43 
    7272233 reg_genmove black 
  • regression/nngs4.tst

    diff -N -r -u -X .ignore gnugo-copy/regression/nngs4.tst gnugo/regression/nngs4.tst
    old new  
    249249#C13 looks correct here /evand 
    250250loadsgf games/nngs/gnugo-3.3.10-niki-200210281349.sgf 144 
    251251610 reg_genmove white 
    252 #? [C13|D13] 
     252#? [C13|D13|B14] 
    253253 
    254254#New failure (3.3.20) 
    255255#pull out the stones /evand