Reinforcement Learning applied to the Snake Game
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
agents
mazes
snake_game
state_mappers
train
.gitignore
README
agent_interact.py
interact.py
keyb_interact.py
main.py
mainloop.py
test_agent_interact.py
test_state_mappers_quadrant_view.py
view_training_data.py

README

Dependencies
============
  * pygame
  * nosetests

Running
=======

Run 

  $ nosetests 

from the root directory to run tests.

Run

  $ python main.py -h

to start playing snake!



Reinforcement Learning applied to the Snake Game
================================================

Directory Structure:
  * agents - consists of rl-agents
  * state_mappers - consists of state-mappers
  * snake_game - consists of logic required for the snake game

Classes/Modules:
  GameState: The current state of the game
    * Position and length of the snake.
    * Position of the Fruit.
    * Positions of the wall(s).
    * Size of the board.

  SnakeLogic: Contains the logic for the entire game
    * The current game state.
    * Function to get the state.
    * Function to get the current score.
    * Function to move the snake.
    * Function to check if the snake is alive.

  MazeConfReader: Reads Configurations from maze files to produce an initial
  game state.
    * A default game state.
    * Read Maze File.

  PyGameArtist: Draws the current state using PyGame.
    * Function to render the current state of the game.

  StateMapper: 
    Abstract class that takes a game state, and returns another (hashable)
    state, with a list of possible moves.

  Agent:
    * Function to perform an action on a state.
    * Function to update it's Q/V values.
    * Function to dump all learning so far (save current learning state)
    * Can be initialised with old Q/V values.