Skip to content

Commit

Permalink
Merge pull request #137 from zakki/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
kobanium committed Sep 2, 2019
2 parents 7fb2f10 + 2784db2 commit d0ec1c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Ladder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ IsLadderCaptured( const int depth, search_game_info_t *game, const int ren_xy, c
int escape_color, capture_color, escape_xy, capture_xy, neighbor;
bool result;

if (depth >= 100) {
if (depth >= 100 || game->moves >= MAX_RECORDS - 1) {
return ALIVE;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ using namespace std;
void
Simulation( game_info_t *game, int starting_color, std::mt19937_64 *mt )
{
int color = starting_color, pos = -1, pass_count = (game->record[game->moves - 1].pos == PASS && game->moves > 1);
int color = starting_color, pos = -1;
int pass_count = 0;

// シミュレーション打ち切り手数を設定
int length = MAX_MOVES - game->moves;
Expand Down
15 changes: 9 additions & 6 deletions src/UctSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1565,16 +1565,19 @@ UctAnalyze( game_info_t *game, int color )
for (int y = board_start; y <= board_end; y++) {
for (int x = board_start; x <= board_end; x++) {
const int pos = POS(x, y);
const double ownership_value = (double)statistic[pos].colors[S_BLACK] / uct_node[current_root].move_count;
if (ownership_value > 0.5) {
black++;
} else {
white++;
const double black_ownership = (double)statistic[pos].colors[S_BLACK] / uct_node[current_root].move_count;
const double white_ownership = (double)statistic[pos].colors[S_WHITE] / uct_node[current_root].move_count;
if (black_ownership > 0.5) {
black++;
}
if (white_ownership > 0.5) {
white++;
}
}
}

PrintOwner(&uct_node[current_root], color, owner);
PrintOwner(&uct_node[current_root], S_BLACK, owner);
PrintOwner(&uct_node[current_root], S_WHITE, owner);

return black - white;
}
Expand Down

0 comments on commit d0ec1c1

Please sign in to comment.