par pitié
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user