mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 19:04:49 +00:00
# Conflicts: # app/src/main/java/org/toop/app/Server.java # app/src/main/java/org/toop/app/gameControllers/GenericGameController.java # app/src/main/java/org/toop/app/widget/view/LocalMultiplayerView.java # framework/src/main/java/org/toop/framework/game/BitboardGame.java # framework/src/main/java/org/toop/framework/game/players/ArtificialPlayer.java # framework/src/main/java/org/toop/framework/game/players/LocalPlayer.java # framework/src/main/java/org/toop/framework/game/players/OnlinePlayer.java # framework/src/main/java/org/toop/framework/game/players/ai/MiniMaxAI.java # framework/src/main/java/org/toop/framework/game/players/ai/RandomAI.java # framework/src/main/java/org/toop/framework/gameFramework/model/game/TurnBasedGame.java # framework/src/main/java/org/toop/framework/gameFramework/model/player/AbstractPlayer.java # game/src/main/java/org/toop/game/players/MiniMaxAI.java # game/src/main/java/org/toop/game/players/RandomAI.java # game/src/main/java/org/toop/game/players/ai/MiniMaxAI.java # game/src/main/java/org/toop/game/players/ai/RandomAI.java
54 lines
1.7 KiB
Java
54 lines
1.7 KiB
Java
package org.toop;
|
|
|
|
import org.toop.app.App;
|
|
|
|
public final class Main {
|
|
static void main(String[] args) {
|
|
App.run(args);
|
|
// testMCTS(10);
|
|
}
|
|
|
|
// Voor onderzoek
|
|
// private static void testMCTS(int games) {
|
|
// var random = new ArtificialPlayer<>(new RandomAI<BitboardReversi>(), "Random AI");
|
|
// var v1 = new ArtificialPlayer<>(new MCTSAI<BitboardTicTacToe>(10), "MCTS V1 AI");
|
|
// var v2 = new ArtificialPlayer<>(new MCTSAI2<BitboardTicTacToe>(10), "MCTS V2 AI");
|
|
// var v2_2 = new ArtificialPlayer<>(new MCTSAI2<BitboardTicTacToe>(100), "MCTS V2_2 AI");
|
|
// var v3 = new ArtificialPlayer<>(new MCTSAI3<BitboardTicTacToe>(10), "MCTS V3 AI");
|
|
|
|
// 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 });
|
|
// }
|
|
|
|
// private static void testAI(int games, Player<BitboardReversi>[] ais) {
|
|
// int wins = 0;
|
|
// int ties = 0;
|
|
|
|
// 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);
|
|
|
|
// match.play(move);
|
|
// }
|
|
|
|
// if (match.getWinner() < 0) {
|
|
// ties++;
|
|
// continue;
|
|
// }
|
|
|
|
// 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);
|
|
// }
|
|
}
|