Reinforcement Learning applied to the Snake Game
spranesh/rl-snake
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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.
About
Reinforcement Learning applied to the Snake Game
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published