Ticket #173: lively-stones-2a.diff

File lively-stones-2a.diff, 1.7 KB (added by gunnar, 4 years ago)

First half of the patch.

  • engine/value_moves.c

    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
    estimate_strategical_value(int pos, int  
    29772977        || (owl_move_reason_known(pos, aa) 
    29782978            && dragon[aa].status == CRITICAL) 
    29792979        || 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 
    29802999      /* But if the strategical value was larger than the territorial 
    29813000       * value (e.g. because connecting to strong dragon) we award the 
    29823001       * excess value as a bonus. 
    29833002       */ 
    2984       float excess_value = (dragon_value[aa] -  
    2985                             2 * DRAGON2(aa).strategic_size); 
     3003      excess_value = (dragon_value[aa] - dragon_ter_val); 
    29863004      if (excess_value > 0.0) { 
    29873005        TRACE("  %1m: %f - strategic bonus for %1m\n", pos, excess_value, aa); 
    29883006        tot_value += excess_value;