MCPcopy Index your code
hub / github.com/LXXXXR/CACOM

github.com/LXXXXR/CACOM @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
259 symbols 642 edges 43 files 34 documented · 13%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Context-aware Communication for Multi-agent Reinforcement Learning

This is the implementation of our paper "Context-aware Communication for Multi-agent Reinforcement Learning" in AAMAS 2024. This repo is based on the open-source pymarl framework, and please refer to that repo for more documentation.

Installation instructions

Set up StarCraft II and SMAC:

bash install_sc2.sh
export SC2PATH=[Your SC2 folder like /abc/xyz/3rdparty/StarCraftII]

Install Python environment with conda:

conda create -n cacom python=3.7 -y
conda activate pymarl

then install with requirements.txt using pip:

pip install -r requirements.txt

Run an experiment

python src/main.py --config=[Algorithm name] --env-config=[Env name] --exp-config=[Experiment name]

The config files 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. --exp-config refers to the config files in src/config/exp. If you want to change the configuration of a particular experiment, you can do so by modifying the yaml file here.

All results will be stored in the work_dirs folder.

For example, run CACOM on MMM3:

python src/main.py --exp-config=mmm3_s0 --config=cacom --env-config=sc2

Citing

If you use this code in your research or find it helpful, please consider citing our paper:

@article{li2024context,
  title={Context-aware Communication for Multi-agent Reinforcement Learning},
  author={Li, Xinran and Zhang, Jun},
  booktitle={accepted by International Conference on Autonomous Agents and Multiagent Systems (AAMAS)},
  year={2024}
}

Core symbols most depended-on inside this repo

log_stat
called by 52
src/utils/logging.py
load
called by 20
src/components/episode_buffer.py
save
called by 17
src/components/episode_buffer.py
init_hidden
called by 13
src/modules/agents/rnn_agent.py
update
called by 13
src/components/episode_buffer.py
parameters
called by 10
src/controllers/basic_controller.py
forward
called by 10
src/modules/mixers/qmix.py
step
called by 9
src/envs/join1.py

Shape

Method 205
Class 33
Function 21

Languages

Python100%

Modules by API surface

src/components/episode_buffer.py23 symbols
src/envs/join1.py19 symbols
src/envs/lbforaging/foraging.py18 symbols
src/envs/multiagentenv.py16 symbols
src/controllers/cacom_controller.py15 symbols
src/runners/parallel_runner.py14 symbols
src/controllers/basic_controller.py13 symbols
src/modules/agents/cacom_agent.py12 symbols
src/runners/episode_runner.py9 symbols
src/modules/agents/rnn_agent.py9 symbols
src/learners/cacom_learner.py9 symbols
src/learners/dmaq_qatten_learner.py8 symbols

For agents

$ claude mcp add CACOM \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact