In ROMA's ICML paper, we use [an old version of the SMAC benchmark](https://arxiv.org/pdf/1902.04043v1.pdf) for both ROMA and the baselines (QMIX, COMA, IQL, MAVEN, QTRAN), and their performance are different from that can be achieved by the latest version.
# ROMA: Multi-Agent Reinforcement Learning with Emergent Roles
## Note
This codebase accompanies the paper submission "ROMA: Multi-Agent Reinforcement Learning with Emergent Roles" ([ROMA website](https://sites.google.com/view/romarl)), and is based on [PyMARL](https://github.com/oxwhirl/pymarl) and [SMAC](https://github.com/oxwhirl/smac) codebases which are open-sourced.
The implementation of the following methods can also be found in this codebase, which are finished by the authors of [PyMARL](https://github.com/oxwhirl/pymarl):
- [**ROMA**: ROMA: Multi-Agent Reinforcement Learning with Emergent Roles](https://arxiv.org/abs/2003.08039)
- [**QMIX**: QMIX: Monotonic Value Function Factorisation for Deep Multi-Agent Reinforcement Learning](https://arxiv.org/abs/1803.11485)
- [**COMA**: Counterfactual Multi-Agent Policy Gradients](https://arxiv.org/abs/1705.08926)
- [**VDN**: Value-Decomposition Networks For Cooperative Multi-Agent Learning](https://arxiv.org/abs/1706.05296)
- [**IQL**: Independent Q-Learning](https://arxiv.org/abs/1511.08779)
## Installation instructions
Build the Dockerfile using
```shell
cd docker
bash build.sh
```
Set up StarCraft II and SMAC:
```shell
bash install_sc2.sh
```
This will download SC2 into the 3rdparty folder and copy the maps necessary to run over.
If you want to run the environments we designed, move all the SC2 maps in `src/envs/starcraft2/map/designed/` to `3rdparty/StarCraftII/Maps/SMAC_Maps/`.
It is worth noting that `bane_vs_bane1` corresponds to `6z4b`, `zb_vs_sz` corresponds to `10z5b_vs_2s3z`, and `sz_vs_zb`
corresponds to `6s4z_vs_10b30z` in the paper.
The requirements.txt file can be used to install the necessary packages into a virtual environment (not recomended).
## Run an experiment
```shell
python3 src/main.py
--config=qmix_smac_latent
--env-config=sc2
with
agent=latent_ce_dis_rnn
env_args.map_name=MMM2
t_max=20050000
```
To test other maps, add parameters
```shell
h_loss_weight=5e-2
var_floor=1e-4
```
The config files act as defaults for an algorithm or environment.
They are all located in `src/config`.
`--config` refers to the config files in `src/config/algs`
`--env-config` refers to the config files in `src/config/envs`
All results will be stored in the `Results` folder.
## Saving and loading learnt models
### Saving models
You can save the learnt models to disk by setting `save_model = True`, which is set to `False` by default. The frequency of saving models can be adjusted using `save_model_interval` configuration. Models will be saved in the result directory, under the folder called *models*. The directory corresponding each run will contain models saved throughout the experiment, each within a folder corresponding to the number of timesteps passed since starting the learning process.
### Loading models
Learnt models can be loaded using the `checkpoint_path` parameter, after which the learning will proceed from the corresponding timestep.
## Watching StarCraft II replays
`save_replay` option allows saving replays of models which are loaded using `checkpoint_path`. Once the model is successfully loaded, `test_nepisode` number of episodes are run on the test mode and a .SC2Replay file is saved in the Replay directory of StarCraft II. Please make sure to use the episode runner if you wish to save a replay, i.e., `runner=episode`. The name of the saved replay file starts with the given `env_args.save_replay_prefix` (map_name if empty), followed by the current timestamp.
The saved replays can be watched by double-clicking on them or using the following command:
```shell
python -m pysc2.bin.play --norender --rgb_minimap_size 0 --replay NAME.SC2Replay
```
**Note:** Replays cannot be watched using the Linux version of StarCraft II. Please use either the Mac or Windows version of the StarCraft II client.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【MADRL】面向角色的多智能体强化学习(ROMA)算法代码 =================================================================== 包含ROMA算法实现的项目代码 =================================================================== 在多智能体系统中,如何让各个智能体有效协作、合理分工,最大化整体性能是一个核心问题。面向角色的多智能体强化学习(Role-Oriented Multi-Agent Reinforcement Learning, ROMA) 算法正是为了解决这一问题而设计的。 在 ROMA 中,“角色”(Role) 是多智能体协作中的核心概念。智能体被分配不同的角色,每个角色决定智能体在任务中的具体职责和行为模式。通过这种角色导向的方式,ROMA 试图提高多智能体系统中的协作效率,同时使得策略学习更加稳定和高效。
资源推荐
资源详情
资源评论
收起资源包目录
ROMA.zip (61个子文件)
ROMA
src
__init__.py 0B
main.py 3KB
controllers
__init__.py 169B
separate_controller.py 6KB
basic_controller.py 4KB
modules
__init__.py 0B
critics
__init__.py 0B
coma.py 3KB
agents
__init__.py 184B
latent_ce_dis_rnn_agent.py 10KB
rnn_agent.py 875B
mixers
__init__.py 0B
qmix.py 2KB
vdn.py 228B
utils
logging.py 2KB
dict2namedtuple.py 132B
timehelper.py 2KB
rl_utils.py 774B
learners
__init__.py 248B
q_learner.py 7KB
coma_learner.py 7KB
latent_q_learner.py 10KB
components
__init__.py 0B
epsilon_schedules.py 770B
episode_buffer.py 11KB
transforms.py 568B
action_selectors.py 3KB
run.py 8KB
envs
__init__.py 563B
multiagentenv.py 2KB
starcraft2
__init__.py 211B
starcraft2.py 55KB
maps
__init__.py 313B
smac_maps.py 8KB
designed
zb_vs_sz.SC2Map 18KB
sz_vs_zb.SC2Map 15KB
bane_vs_bane1.SC2Map 15KB
gfootball
__init__.py 46B
gfootball.py 8KB
.gitignore 18B
runners
__init__.py 176B
episode_runner.py 4KB
parallel_runner.py 10KB
config
envs
sc2.yaml 797B
gf.yaml 868B
algs
coma_smac.yaml 672B
iql_smac.yaml 448B
vdn_smac.yaml 434B
qmix_smac.yaml 480B
qmix.yaml 532B
qmix_smac_latent_gf.yaml 857B
qmix_smac_latent.yaml 822B
default.yaml 2KB
LICENSE 11KB
docker
Dockerfile 2KB
build.sh 96B
run_interactive.sh 482B
requirements.txt 810B
run.sh 479B
README.md 4KB
install_sc2.sh 885B
共 61 条
- 1
资源评论
不去幼儿园
- 粉丝: 1w+
- 资源: 40
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功