Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Reinforcement Learning applied to the Snake Game http://spranesh.github.io/rl-snake
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
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.