Package communication
Class Connection
java.lang.Object
communication.Connection
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConnection(boolean isPlayer, boolean useOpeningLib) Constructs a Connection object.Connection(boolean isPlayer, boolean switchMCTS, double MCTSTime, boolean useOpeningLib) Constructs a Connection object. -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Connects to the game server and manages game play.static voidMain method to start the connection and game play.voidreadFileAndFillBib(String fileLocation) Fills the startingBib HashMap with precalculated starting moves.
-
Field Details
-
switchMCTS
public boolean switchMCTS -
useOpeningLib
public boolean useOpeningLib
-
-
Constructor Details
-
Connection
public Connection(boolean isPlayer, boolean switchMCTS, double MCTSTime, boolean useOpeningLib) Constructs a Connection object.- Parameters:
isPlayer- Indicates if the player is a human player (true) or AI (false).switchMCTS- Indicates if the AI should switch to MCTS after MCTSTime.MCTSTime- The time limit after which to switch to MCTS (in ms). Defaults to 100ms if not provided.useOpeningLib- Indicates if the AI should use an opening library.
-
Connection
public Connection(boolean isPlayer, boolean useOpeningLib) Constructs a Connection object.- Parameters:
isPlayer- Indicates if the player is a human player (true) or AI (false).useOpeningLib- Indicates if the AI should use an opening library.
-
-
Method Details
-
connect
public void connect()Connects to the game server and manages game play. -
readFileAndFillBib
Fills the startingBib HashMap with precalculated starting moves.- Parameters:
fileLocation- Path to the File- Throws:
IOException
-
main
Main method to start the connection and game play.- Parameters:
args- Command line arguments (not used).- Throws:
InterruptedException- if the main thread is interrupted.
-