Skip to content

Commit d32ee21

Browse files
committed
Initial Commit
0 parents  commit d32ee21

File tree

664 files changed

+18439
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

664 files changed

+18439
-0
lines changed

README.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Competition_3v3snakes
2+
3+
### Environment
4+
5+
<!-- ![image](https://github.com/jidiai/Competition_3v3snakes/blob/master/assets/snakesdemo.gif) -->
6+
<img src="https://github.com/jidiai/Competition_3v3snakes/blob/master/assets/snakesdemo.gif" alt="Competition_3v3snakes" width="500" height="250" align="middle" />
7+
8+
Check details in Jidi Competition [RLChina2021智能体竞赛](http://www.jidiai.cn/compete_detail?compete=6)
9+
10+
---
11+
### Dependency
12+
You need to create competition environment.
13+
>conda create -n snake1v1 python=3.6
14+
15+
>conda activate snake1v1
16+
17+
>pip install -r requirements.txt
18+
19+
---
20+
### How to train rl-agent
21+
22+
>python rl_trainer/main.py
23+
24+
By default-parameters, the total reward of training is shown below.
25+
26+
![image](https://github.com/jidiai/Competition_3v3snakes/blob/master/assets/training.png)
27+
28+
29+
You can edit different parameters, for example
30+
31+
>python rl_trainer/main.py --algo "bicnet" --epsilon 0.8
32+
33+
Baseline performance:
34+
35+
You can locally evaluation your model.
36+
37+
>python evaluation_local.py --my_ai rl --opponent random
38+
39+
![image](https://github.com/jidiai/Competition_3v3snakes/blob/master/assets/baseline.png)
40+
41+
42+
---
43+
### How to test submission
44+
You can locally test your submission. At Jidi platform, we evaluate your submission as same as **run_log.py**
45+
46+
Once you run this file, you can locally check battle logs in the folder named "logs".
47+
48+
For example,
49+
>python run_log.py --my_ai "random" --opponent "rl"
50+
51+
---
52+
### Ready to submit
53+
54+
1. Random policy --> **agent/random/submission.py**
55+
2. RL policy --> **all files in agent/rl/**
56+
57+
---
58+
### Watch reply locally
59+
60+
1. Open reply/reply.html in any browser.
61+
2. Load a log.
62+
3. Reply and watch ^0^.
63+
64+
65+
66+
[comment]: <> (## Content)
67+
68+
[comment]: <> (```)
69+
70+
[comment]: <> (|-- Competition_3v3snakes // https://github.com/jidiai/Competition_3v3snakes.git)
71+
72+
[comment]: <> ( |-- env // game environments)
73+
74+
[comment]: <> ( | |-- obs_interfaces // Super Class)
75+
76+
[comment]: <> ( | | |-- observation.py // support Grid interface)
77+
78+
[comment]: <> ( | |-- simulators // Super Class)
79+
80+
[comment]: <> ( | | |-- game.py)
81+
82+
[comment]: <> ( | | |-- gridgame.py )
83+
84+
[comment]: <> ( | |-- config.ini // env config)
85+
86+
[comment]: <> ( | |-- chooseenv.py )
87+
88+
[comment]: <> ( | |-- snakes.py)
89+
90+
[comment]: <> ( |-- examples)
91+
92+
[comment]: <> ( | |-- random // random policy)
93+
94+
[comment]: <> ( | | |-- submission.py // you can submit this file to the platform without any modification)
95+
96+
[comment]: <> ( | |-- myagent // customize policy)
97+
98+
[comment]: <> ( | | |-- dqn.py )
99+
100+
[comment]: <> ( | | |-- submission.py // main file,which should contain function named `my_controller`)
101+
102+
[comment]: <> ( |-- utils )
103+
104+
[comment]: <> ( |-- run_log.py // run an episode and generate .json log)
105+
106+
[comment]: <> ( |-- replay // replay local util. Click replay.html and upload the json generated by run_log.py to replay )
107+
108+
[comment]: <> (```)
109+
110+
111+
112+
113+
114+
115+
4.52 KB
Binary file not shown.

0 commit comments

Comments
 (0)