# MAgent **Repository Path**: qretaw/MAgent ## Basic Information - **Project Name**: MAgent - **Description**: https://github.com/geek-ai/MAgent.git - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-06-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README


## Requirement
MAgent supports Linux and OS X running Python 2.7 or python 3.
We make no assumptions about the structure of your agents.
You can write rule-based algorithms or use deep learning frameworks.
## Install on Linux
```bash
git clone git@github.com:geek-ai/MAgent.git
cd MAgent
sudo apt-get install cmake libboost-system-dev libjsoncpp-dev libwebsocketpp-dev
bash build.sh
export PYTHONPATH=$(pwd)/python:$PYTHONPATH
```
## Install on OSX
**Note: There is an issue with homebrew for installing websocketpp, please refer to [#17](https://github.com/geek-ai/MAgent/issues/17)**
```bash
git clone git@github.com:geek-ai/MAgent.git
cd MAgent
brew install cmake llvm boost@1.55
brew install jsoncpp argp-standalone
brew tap david-icracked/homebrew-websocketpp
brew install --HEAD david-icracked/websocketpp/websocketpp
brew link --force boost@1.55
bash build.sh
export PYTHONPATH=$(pwd)/python:$PYTHONPATH
```
## Docs
[Get started](/doc/get_started.md)
## Examples
The training time of following tasks is about 1 day on a GTX1080-Ti card.
If out-of-memory errors occur, you can tune infer_batch_size smaller in models.
**Note** : You should run following examples in the root directory of this repo. Do not cd to `examples/`.
### Train
Three examples shown in the above video.
Video files will be saved every 10 rounds. You can use render to watch them.
* **pursuit**
```
python examples/train_pursuit.py --train
```
* **gathering**
```
python examples/train_gather.py --train
```
* **battle**
```
python examples/train_battle.py --train
```
### Play
An interactive game to play with battle agents. You will act as a general and dispatch your soldiers.
* **battle game**
```
python examples/show_battle_game.py
```
## Baseline Algorithms
The baseline algorithms parameter-sharing DQN, DRQN, a2c are implemented in Tensorflow and MXNet.
DQN performs best in our large number sharing and gridworld settings.
## Acknowledgement
Many thanks to [Tianqi Chen](https://tqchen.github.io/) for the helpful suggestions.