This repo houses accompanying files for my postgraduate dissertation. The dissertation itself is available upon request.
To play the game from a random state with all pieces on the board:
- From terminal, CD into
thesis/src
python3 game_with_ui.py
will run the game- Optional flag
-f [filename]
allows you to log the game to a text file - Either point and click to select pieces or press keys to execute AI for a single move
R
key executes a random moveM
key executes MCTSS
key executes Swarm AI
To play a game from a saved log file:
- From terminal, CD into
thesis/src
python3 log_replay.py -f [log_file]
- Optional flag
-ai
to start control after the random moves - Use
LEFT
andRIGHT
arrow keys to go back and forward in time - The terminal displays if a random move or an AI move is being executed
game
- all algorithms and logic to play the game of Hive, mainly insect move algorithmsgame_with_ui
- directly executable to play a game using the UI, with each move given the option to be controlled manually or by AI (see instructions above)game_without_ui
- can be instantiated and started with.play_full_game()
to play a game with only AIs and save to logsinsects
- base classes for each playable insect, including meta-insectsStack
andBlank
log_replay
- directly executable via the above instructions to replay a log using the UImcts
- implementation of root-parallelised Monte-Carlo Search Treestate
- data class holding the current state of the gameboard
- data class holding the matrix of insects/meta-insectsaction
- data class holding a single action for MCTS to executeswarm
- implementation of PSO, allowing for global/local PSO and intentions communicationstests
- test class to gather logsutils
- helper functions which do not require game statecount_hives
- Depth-first search to count the number of Hives present on the board (One-Hive Rule)