2048_Planning
2048 Agent using Monte Carlo method, can reach 4096. It has a cnn layer to extract checkerboard feature and a lstm layer to make logic decision, and utilize a strong model to train itself.
Code structure
game2048/
: the main package.montecarlo.py
: the main model for this planning methodgame.py
: the core 2048Game
class.agents.py
: theAgent
class with instances.displays.py
: theDisplay
class with instances, to show theGame
state.expectimax/
: a powerful ExpectiMax agent by here.
explore.ipynb
: introduce how to use theAgent
,Display
andGame
.static/
: frontend assets (based on Vue.js) for web app.webapp.py
: run the web app (backend) demo.evaluate.py
: evaluate your self-defined agent.
Requirements
- code only tested on linux system (ubuntu 16.04)
- Python 3 (Anaconda 3.6.3 specifically) with numpy and flask
Run the web app
python3 webapp.py
Then it automatically run the planing agent. After a few minutes, you will get the result.