/
README
62 lines (44 loc) · 1.45 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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.