Welcome on the repo presenting my own implementation of Reinforcement Learning using for snake control.
The agent part structure is inspired by Patrick Loebers work.
docker-compose up
Runs a demo with using model
Runs using pretrained model from:
/snake-rl/src/models/q_learning_net_without_wall_transparency.pth
It's a simple flask project enabling the communication between environment state and snake-visualizer app.
It contains two endpoints:
Gets json data and emits it using socketio for listeners observing new_environment
event
Returns ok if service is available.
Simple React + Three.js application for visualizing snake in 2D grid of boxes.
It uses following json properties:
x_rows (int)
- gives number of columns in x directiony_rows (int)
- gives number of columns in y directionis_sphere (bool)
- if true displays snake grid as sphere else as 2d boardis_alive (bool)
- status of snakereward (int)
- reward in the current gamescore (int)
- score in the current gamenumber_of_steps (int)
- total number of steps in the gamenumber_of_steps_without_food (int)
- number of steps since the last chunk of food was foundnumber_of_games (int)
- total number of games
Please read detailed description of the snake concept in designated folder: