Skip to content

Commit

Permalink
might fix a rare multi-threaded UCB1-GRAVE crash
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisSoemers committed May 25, 2024
1 parent ef40e13 commit 79d02cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AI/src/search/mcts/selection/UCB1GRAVE.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public int select(final MCTS mcts, final BaseNode current)
// System.out.println("current context legal moves = " + current.contextRef().activeGame().moves(current.contextRef()));
// }

final int childVisits = child.numVisits() + child.numVirtualVisits();
final int childVisits = Math.max(child.numVisits() + child.numVirtualVisits(), 1);

if (graveStats == null)
{
Expand Down

0 comments on commit 79d02cf

Please sign in to comment.