AI: fixed MCTS (Monte Carlo) errors in some simulations (#10154);

This commit is contained in:
Oleg Agafonov 2024-06-10 21:54:53 +04:00
parent c8b5c1fa35
commit 72cf60085c
2 changed files with 76 additions and 3 deletions

View file

@ -94,8 +94,10 @@ public class ComputerPlayerMCTS extends ComputerPlayer {
root = new MCTSNode(playerId, sim);
}
applyMCTS(game, action);
root = root.bestChild();
root.emancipate();
if (root != null && root.bestChild() != null) {
root = root.bestChild();
root.emancipate();
}
}
protected void getNextAction(Game game, NextAction nextAction) {