diff --git a/README.md b/README.md index caad7c0..0cc2a7e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ This is the GUI support for the [RLCard](https://github.com/datamllab/rlcard) pr * Official Website: [http://www.rlcard.org](http://www.rlcard.org) * Tutorial in Jupyter Notebook: [https://github.com/datamllab/rlcard-tutorial](https://github.com/datamllab/rlcard-tutorial) * Paper: [https://www.ijcai.org/Proceedings/2020/764](https://www.ijcai.org/Proceedings/2020/764) +* Document: [click here](docs/README.md) ## Cite this work If you find this repo useful, you may cite: @@ -25,7 +26,7 @@ If you find this repo useful, you may cite: ``` ## Installation -RLCard-Showdown has separated frontend and backend. The frontend is built with React and the backend is based on Django. +RLCard-Showdown has separated frontend and backend. The frontend is built with React and the backend of leaderboard is based on Django. ### Prerequisite To set up the frontend, you should make sure you have [Node.js](https://nodejs.org/) and NPM installed. Normally you just need to manually install Node.js, and the NPM package would be automatically installed together with Node.js for you. Please refer to its official website for installation of Node.js. @@ -35,34 +36,34 @@ You can run the following commands to verify the installation node -v npm -v ``` -For backend, make sure that you have **Python 3.5+** and **pip** installed. +For backend, make sure that you have **Python 3.6+** and **pip** installed. ### Install Frontend and Backend The frontend can be installed with the help of NPM: ``` -git clone https://github.com/datamllab/rlcard-showdown.git +git clone --depth 1 https://github.com/datamllab/rlcard-showdown.git cd rlcard-showdown npm install ``` -The backend can be installed with +The backend of leaderboard can be installed with ``` -pip install -r requirements.txt +pip3 install -r requirements.txt cd server -python manage.py migrate +python3 manage.py migrate cd .. ``` ### Run RLCard-Showdown -Launch the backend with +Launch the backend of leaderboard with ``` cd server -python manage.py runserver +python3 manage.py runserver ``` Run the following command in a new terminal under the project folder to start frontend in development mode: ``` npm start ``` -The frontend will be started in port 3000 in localhost by default. You can view it at [http://127.0.0.1:3000/](http://127.0.0.1:3000/). The backend will run by default in [http://127.0.0.1:8000/](http://127.0.0.1:8000/). +You can view frontend at [http://127.0.0.1:3000/](http://127.0.0.1:3000/). The backend of leaderboard will run in [http://127.0.0.1:8000/](http://127.0.0.1:8000/). More documentation can be found [here](docs/api.md). User guide is [here](docs/guide.md). @@ -73,7 +74,7 @@ More documentation can be found [here](docs/api.md). User guide is [here](docs/g ![leduc-replay](https://github.com/datamllab/rlcard-showdown/blob/master/docs/imgs/leduc-replay.png?raw=true) ### Contact Us -If you have any questions or feedback, feel free to drop an email to [Songyi Huang](mailto:songyih@sfu.ca) for the frontend or [Daochen Zha](http://dczha.com/) for backend. +If you have any questions or feedback, feel free to drop an email to [Songyi Huang](https://github.com/hsywhu) for the frontend or [Daochen Zha](https://github.com/daochenzha) for backend. ### Acknowledgements We would like to thank JJ World Network Technology Co., LTD for the generous support, [Chieh-An Tsai](https://anntsai.myportfolio.com/) for user interface design, and [Lei Pan](mailto:lpa25@sfu.ca) for the help in visualizations. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..20119f9 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,4 @@ +# Document of RLCard-Showdown + +* [User Guide](guide.md) +* [API Document of Leaderboard](leaderboard_api.md) diff --git a/docs/api.md b/docs/leaderboard_api.md similarity index 100% rename from docs/api.md rename to docs/leaderboard_api.md diff --git a/requirements.txt b/requirements.txt index 820562b..7fe585e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,7 @@ -rlcard +rlcard[training] Django tqdm django-cors-headers -torch==1.6.0 flask==1.1 flask-cors onnx diff --git a/server/media/example_agents/example_luduc_nfsp_model.zip b/server/media/example_agents/example_luduc_nfsp_model.zip deleted file mode 100644 index 83aafac..0000000 Binary files a/server/media/example_agents/example_luduc_nfsp_model.zip and /dev/null differ diff --git a/server/media/example_agents/example_luduc_rule_model.zip b/server/media/example_agents/example_luduc_rule_model.zip deleted file mode 100644 index bfad00f..0000000 Binary files a/server/media/example_agents/example_luduc_rule_model.zip and /dev/null differ diff --git a/server/media/example_agents/leduc_holdem_dqn.zip b/server/media/example_agents/leduc_holdem_dqn.zip new file mode 100644 index 0000000..37c6dfb Binary files /dev/null and b/server/media/example_agents/leduc_holdem_dqn.zip differ diff --git a/server/tournament/tournament.py b/server/tournament/tournament.py index 83c561b..6f6f306 100644 --- a/server/tournament/tournament.py +++ b/server/tournament/tournament.py @@ -89,7 +89,7 @@ def doudizhu_tournament(game, agents, names, num_eval_games): data['moveHistory'].append(history) state, player_id = env.step(action, env.agents[player_id].use_raw) - data = json.dumps(data) + data = json.dumps(str(data)) #data = json.dumps(data, indent=2, sort_keys=True) json_data.append(data) if env.get_payoffs()[0] > 0: @@ -150,7 +150,7 @@ def leduc_holdem_tournament(game, agents, num_eval_games): round_history = [] perfect = env.get_perfect_information() data['publicCard'] = perfect['public_card'] - data = json.dumps(data) + data = json.dumps(str(data)) #data = json.dumps(data, indent=2, sort_keys=True) json_data.append(data) if env.get_payoffs()[0] > 0: