A multithreaded Java implementation of MCTS for the Game of Amazons. This AI was created for a class tournament in the course COSC 322 Introduction to Artificial Intelligence.
- Lockless multithreading
- Efficient chamber analysis using bitwise operations
- Hybrid roullouts with endgame detection
- Splitting players turns into two layers to mitigate the large branching factor
To compete with this ai compile the jar with COSC322Test as the main class.
# run with gui
java -jar team-01.jar username password
# run with no gui
java -jar team-01.jar username password nogui
To test locally checkout the LocalTest class!
All of the functional bits for our AI are in java.ubc.cosc322.engine. The rest is mostly just code wrapping the prof's API.
new MonteCarloPlayer(
() -> new SwitchHeuristic(
60, // switch between heuristics at move 60 (turn 30)
// full rollouts first
new RolloutHeuristic(
new RandomPlayer(new LegalMoveGenerator())
),
// hybrid rollouts second for improved endgame
new HybridRolloutHeuristic(
new RandomPlayer(new ContestedMoveGenerator())
)
),
() -> new LegalMoveGenerator(),
Runtime.getRuntime().availableProcessors(), // 1 thread per core
28000, // 28 second thinking time
0.6 // UCT exploration factor
);