Implement max thread count setting using semaphores

This commit is contained in:
Asriel Camora
2023-10-02 23:02:11 -07:00
parent 42a1bc1117
commit 6bfff06ac4
5 changed files with 62 additions and 20 deletions
+1 -2
View File
@@ -285,8 +285,7 @@ public sealed class MCTS
var n = 0;
for (var i = 0; i < iterations || MaxScore == 0; i++)
{
if (token.IsCancellationRequested)
break;
token.ThrowIfCancellationRequested();
var selectedNode = Select();
var (endNode, score) = ExpandAndRollout(random, simulator, selectedNode);