AI wait fixes

This commit is contained in:
lieght
2026-01-22 11:10:55 +01:00
parent f37c578a35
commit b5bd4adf91
3 changed files with 2 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ public class MCTSAI3 extends MCTSAI {
} }
try { try {
threadPool.awaitTermination(milliseconds + 50, TimeUnit.MILLISECONDS); threadPool.awaitTermination(milliseconds, TimeUnit.MILLISECONDS);
lastIterations = root.visits.get(); lastIterations = root.visits.get();

View File

@@ -42,7 +42,7 @@ public class MCTSAI4 extends MCTSAI {
} }
try { try {
threadPool.awaitTermination(milliseconds + 50, TimeUnit.MILLISECONDS); threadPool.awaitTermination(milliseconds, TimeUnit.MILLISECONDS);
lastIterations = root.visits.get(); lastIterations = root.visits.get();

View File

@@ -88,7 +88,6 @@ public class AITest {
match.init(players); match.init(players);
while (!match.isTerminal()) { while (!match.isTerminal()) {
final int currentAI = match.getCurrentTurn(); final int currentAI = match.getCurrentTurn();
final long startTime = System.nanoTime(); final long startTime = System.nanoTime();
final long move = players[currentAI].getMove(match); final long move = players[currentAI].getMove(match);
final long endTime = System.nanoTime(); final long endTime = System.nanoTime();