Skip to content

Commit

Permalink
adjust child utility when it has mate bound
Browse files Browse the repository at this point in the history
test f15
  • Loading branch information
dhbloo committed Oct 15, 2024
1 parent 58ed3f3 commit 54d1b61
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Rapfi/search/mcts/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,16 @@ std::pair<Edge *, Node *> selectChild(Node &node, const Board &board)
uint32_t childVirtualVisits = childNode->getVirtualVisits();
float childUtility = -childNode->getQ();
float childDraw = childNode->getD();
float selectionValue = puctSelectionValue(childUtility,

ValueBound childBound = childNode->getBound();
// Do not select non-mate child when there is a mate child
if (childBound.childLowerBound() >= VALUE_MATED_IN_MAX_PLY)
childUtility += 1.0f;
// Do not select mated child when there is a non-mated child
if (childBound.childUpperBound() <= VALUE_MATED_IN_MAX_PLY)
childUtility -= 1.0f;

float selectionValue = puctSelectionValue(childUtility,
childDraw,
parentDraw,
childPolicy,
Expand Down

0 comments on commit 54d1b61

Please sign in to comment.