Code Monkey home page Code Monkey logo

thesis's Introduction

This repo houses accompanying files for my postgraduate dissertation. The dissertation itself is available upon request.

Execution Instructions

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 move
    • M key executes MCTS
    • S key executes Swarm AI

Log Replay Instructions

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 and RIGHT arrow keys to go back and forward in time
  • The terminal displays if a random move or an AI move is being executed

Class Descriptions

  • game - all algorithms and logic to play the game of Hive, mainly insect move algorithms
  • game_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 logs
  • insects - base classes for each playable insect, including meta-insects Stack and Blank
  • log_replay - directly executable via the above instructions to replay a log using the UI
  • mcts - implementation of root-parallelised Monte-Carlo Search Tree
  • state - data class holding the current state of the game
  • board - data class holding the matrix of insects/meta-insects
  • action - data class holding a single action for MCTS to execute
  • swarm - implementation of PSO, allowing for global/local PSO and intentions communications
  • tests - test class to gather logs
  • utils - helper functions which do not require game state
  • count_hives - Depth-first search to count the number of Hives present on the board (One-Hive Rule)

thesis's People

Contributors

mcguile avatar

Watchers

James Cloos avatar Steve Linton avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.