File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1352,6 +1352,7 @@ static bool
13521352ExtendTime ( void )
13531353{
13541354 int max = 0 , second = 0 ;
1355+ int max_index = 0 ;
13551356 const int child_num = uct_node[current_root].child_num ;
13561357 child_node_t *uct_child = uct_node[current_root].child ;
13571358
@@ -1360,6 +1361,7 @@ ExtendTime( void )
13601361 if (uct_child[i].move_count > max) {
13611362 second = max;
13621363 max = uct_child[i].move_count ;
1364+ max_index = i;
13631365 } else if (uct_child[i].move_count > second) {
13641366 second = uct_child[i].move_count ;
13651367 }
@@ -1368,10 +1370,30 @@ ExtendTime( void )
13681370 // 最善手の探索回数がが次善手の探索回数の
13691371 // 1.2倍未満なら探索延長
13701372 if (max < second * 1.2 ) {
1373+ if (GetDebugMessageMode ()) {
1374+ cerr << " Extend time "
1375+ << FormatMove (uct_child[max_index].pos ) << " max:" << max
1376+ << " second:" << second << endl;
1377+ }
13711378 return true ;
1372- } else {
1373- return false ;
13741379 }
1380+
1381+ // Extend time if policy value is too low
1382+ if (uct_node[current_root].evaled ) {
1383+ if (uct_child[max_index].nnrate < 0.02 ) {
1384+ if (GetDebugMessageMode ()) {
1385+ cerr << " Extend time "
1386+ << FormatMove (uct_child[max_index].pos ) << " policy:" << uct_child[max_index].nnrate << endl;
1387+ }
1388+ return true ;
1389+ } else {
1390+ if (GetDebugMessageMode ()) {
1391+ cerr << " Stop policy:" << uct_child[max_index].nnrate << endl;
1392+ }
1393+ }
1394+ }
1395+
1396+ return false ;
13751397}
13761398
13771399
You can’t perform that action at this time.
0 commit comments