diff --git a/app/src/main/java/org/toop/Main.java b/app/src/main/java/org/toop/Main.java index 874276a..87171ff 100644 --- a/app/src/main/java/org/toop/Main.java +++ b/app/src/main/java/org/toop/Main.java @@ -13,49 +13,50 @@ import org.toop.game.players.ai.RandomAI; public final class Main { static void main(String[] args) { - // App.run(args); - testMCTS(10); + App.run(args); + // testMCTS(10); } - private static void testMCTS(int games) { - var random = new ArtificialPlayer<>(new RandomAI(), "Random AI"); - var v1 = new ArtificialPlayer<>(new MCTSAI(10), "MCTS V1 AI"); - var v2 = new ArtificialPlayer<>(new MCTSAI2(10), "MCTS V2 AI"); - var v2_2 = new ArtificialPlayer<>(new MCTSAI2(100), "MCTS V2_2 AI"); - var v3 = new ArtificialPlayer<>(new MCTSAI3(10), "MCTS V3 AI"); + // Voor onderzoek + // private static void testMCTS(int games) { + // var random = new ArtificialPlayer<>(new RandomAI(), "Random AI"); + // var v1 = new ArtificialPlayer<>(new MCTSAI(10), "MCTS V1 AI"); + // var v2 = new ArtificialPlayer<>(new MCTSAI2(10), "MCTS V2 AI"); + // var v2_2 = new ArtificialPlayer<>(new MCTSAI2(100), "MCTS V2_2 AI"); + // var v3 = new ArtificialPlayer<>(new MCTSAI3(10), "MCTS V3 AI"); - testAI(games, new Player[]{ v1, v2 }); - // testAI(games, new Player[]{ v1, v3 }); + // testAI(games, new Player[]{ v1, v2 }); + // // testAI(games, new Player[]{ v1, v3 }); - // testAI(games, new Player[]{ random, v3 }); - // testAI(games, new Player[]{ v2, v3 }); - testAI(games, new Player[]{ v2, v3 }); - // testAI(games, new Player[]{ v3, v2 }); - } + // // testAI(games, new Player[]{ random, v3 }); + // // testAI(games, new Player[]{ v2, v3 }); + // testAI(games, new Player[]{ v2, v3 }); + // // testAI(games, new Player[]{ v3, v2 }); + // } - private static void testAI(int games, Player[] ais) { - int wins = 0; - int ties = 0; + // private static void testAI(int games, Player[] ais) { + // int wins = 0; + // int ties = 0; - for (int i = 0; i < games; i++) { - final BitboardReversi match = new BitboardReversi(ais); + // for (int i = 0; i < games; i++) { + // final BitboardReversi match = new BitboardReversi(ais); - while (!match.isTerminal()) { - final int currentAI = match.getCurrentTurn(); - final long move = ais[currentAI].getMove(match); + // while (!match.isTerminal()) { + // final int currentAI = match.getCurrentTurn(); + // final long move = ais[currentAI].getMove(match); - match.play(move); - } + // match.play(move); + // } - if (match.getWinner() < 0) { - ties++; - continue; - } + // if (match.getWinner() < 0) { + // ties++; + // continue; + // } - wins += match.getWinner() == 0? 1 : 0; - } + // wins += match.getWinner() == 0? 1 : 0; + // } - System.out.printf("Out of %d games, %s won %d -- tied %d -- lost %d, games against %s\n", games, ais[0].getName(), wins, ties, games - wins - ties, ais[1].getName()); - System.out.printf("Average win rate was: %.2f\n\n", wins / (float)games); - } + // System.out.printf("Out of %d games, %s won %d -- tied %d -- lost %d, games against %s\n", games, ais[0].getName(), wins, ties, games - wins - ties, ais[1].getName()); + // System.out.printf("Average win rate was: %.2f\n\n", wins / (float)games); + // } }