par pitié

This commit is contained in:
vaisse
2026-02-06 11:00:03 +01:00
parent 05871232bd
commit 98c6b4678e
4 changed files with 97 additions and 96 deletions

View File

@@ -37,7 +37,7 @@ public class MonteCarloBot extends AbstractGamePlayer {
private float monteCarloSimulation(HexBoard board) {
RandomBot simBot = new RandomBot(Player.PLAYER1, new Random().nextLong());
HexBoard simBoard = board.safeCopy();
HexBoard simBoard = (HexBoard) board.safeCopy();
int wins = 0;
int simulations = 0;
@@ -51,7 +51,7 @@ public class MonteCarloBot extends AbstractGamePlayer {
wins++;
}
simulations++;
simBoard = board.safeCopy(); // Reset the board for the next simulation
simBoard = (HexBoard) board.safeCopy(); // Reset the board for the next simulation
}
return (float) wins / simulations;