Package benchmark.simulation
Class Simulation
java.lang.Object
benchmark.simulation.Simulation
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass to represent the result of a game, including the winning AI and the color. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbytesToGigabytes(long bytes) static voidMain method to run a simulation between two AIs using predefined configurations and an initial board state.static Simulation.GameResultplayGame(AI firstAI, SearchConfig firstConfig, AI secondAI, SearchConfig secondConfig, String fen, boolean showGame) Plays a full game between two AIs using the provided configurations and initial board state.voidsimulate(AI firstAI, SearchConfig firstConfig, AI secondAI, SearchConfig secondConfig, String fen, int iterations, boolean showGame) Simulates a series of games between two AIs using the provided configurations and initial board state.
-
Constructor Details
-
Simulation
public Simulation()
-
-
Method Details
-
playGame
public static Simulation.GameResult playGame(AI firstAI, SearchConfig firstConfig, AI secondAI, SearchConfig secondConfig, String fen, boolean showGame) Plays a full game between two AIs using the provided configurations and initial board state.- Parameters:
firstAI- The first AI that will play.firstConfig- The configuration for the first AI's search algorithm.secondAI- The second AI that will play.secondConfig- The configuration for the second AI's search algorithm.fen- The initial board state in FEN format.showGame- Whether to show the game play.- Returns:
- An integer indicating the winner of the game. Returns 1 if the first AI wins, 2 if the second AI wins.
-
simulate
public void simulate(AI firstAI, SearchConfig firstConfig, AI secondAI, SearchConfig secondConfig, String fen, int iterations, boolean showGame) Simulates a series of games between two AIs using the provided configurations and initial board state. The results of each game and the overall win counts for each AI are printed to the console.- Parameters:
firstAI- The first AI that will play.firstConfig- The configuration for the first AI's search algorithm.secondAI- The second AI that will play.secondConfig- The configuration for the second AI's search algorithm.fen- The initial board state in FEN format.iterations- The number of iterations (games) to simulate. Must be an even number.showGame- Whether to show the game play.
-
bytesToGigabytes
-
main
Main method to run a simulation between two AIs using predefined configurations and an initial board state. Prints results to a file.- Parameters:
args- Command line arguments (not used).
-