├── .github ├── unittest │ ├── install_dependencies.sh │ ├── install_dependencies_nightly.sh │ ├── install_magent2.sh │ ├── install_meltingpot.sh │ ├── install_pettingzoo.sh │ ├── install_smacv2.sh │ └── install_vmas.sh └── workflows │ ├── lint.yml │ ├── magent_tests.yml │ ├── meltingpot_tests.yml │ ├── pettingzoo_tests.yml │ ├── smacv2_tests.yml │ ├── torchrl_stable_tests.yml │ ├── unit_tests.yml │ └── vmas_tests.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── CITATION.cff ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── benchmarl ├── __init__.py ├── algorithms │ ├── __init__.py │ ├── common.py │ ├── ensemble.py │ ├── iddpg.py │ ├── ippo.py │ ├── iql.py │ ├── isac.py │ ├── maddpg.py │ ├── mappo.py │ ├── masac.py │ ├── qmix.py │ └── vdn.py ├── benchmark │ ├── __init__.py │ └── benchmark.py ├── conf │ ├── __init__.py │ ├── algorithm │ │ ├── iddpg.yaml │ │ ├── ippo.yaml │ │ ├── iql.yaml │ │ ├── isac.yaml │ │ ├── maddpg.yaml │ │ ├── mappo.yaml │ │ ├── masac.yaml │ │ ├── qmix.yaml │ │ └── vdn.yaml │ ├── config.yaml │ ├── experiment │ │ └── base_experiment.yaml │ ├── model │ │ ├── layers │ │ │ ├── cnn.yaml │ │ │ ├── deepsets.yaml │ │ │ ├── gnn.yaml │ │ │ ├── gru.yaml │ │ │ ├── lstm.yaml │ │ │ └── mlp.yaml │ │ └── sequence.yaml │ └── task │ │ ├── magent │ │ └── adversarial_pursuit.yaml │ │ ├── meltingpot │ │ ├── allelopathic_harvest__open.yaml │ │ ├── bach_or_stravinsky_in_the_matrix__arena.yaml │ │ ├── bach_or_stravinsky_in_the_matrix__repeated.yaml │ │ ├── boat_race__eight_races.yaml │ │ ├── chemistry__three_metabolic_cycles.yaml │ │ ├── chemistry__three_metabolic_cycles_with_plentiful_distractors.yaml │ │ ├── chemistry__two_metabolic_cycles.yaml │ │ ├── chemistry__two_metabolic_cycles_with_distractors.yaml │ │ ├── chicken_in_the_matrix__arena.yaml │ │ ├── chicken_in_the_matrix__repeated.yaml │ │ ├── clean_up.yaml │ │ ├── coins.yaml │ │ ├── collaborative_cooking__asymmetric.yaml │ │ ├── collaborative_cooking__circuit.yaml │ │ ├── collaborative_cooking__cramped.yaml │ │ ├── collaborative_cooking__crowded.yaml │ │ ├── collaborative_cooking__figure_eight.yaml │ │ ├── collaborative_cooking__forced.yaml │ │ ├── collaborative_cooking__ring.yaml │ │ ├── commons_harvest__closed.yaml │ │ ├── commons_harvest__open.yaml │ │ ├── commons_harvest__partnership.yaml │ │ ├── coop_mining.yaml │ │ ├── daycare.yaml │ │ ├── externality_mushrooms__dense.yaml │ │ ├── factory_commons__either_or.yaml │ │ ├── fruit_market__concentric_rivers.yaml │ │ ├── gift_refinements.yaml │ │ ├── hidden_agenda.yaml │ │ ├── paintball__capture_the_flag.yaml │ │ ├── paintball__king_of_the_hill.yaml │ │ ├── predator_prey__alley_hunt.yaml │ │ ├── predator_prey__open.yaml │ │ ├── predator_prey__orchard.yaml │ │ ├── predator_prey__random_forest.yaml │ │ ├── prisoners_dilemma_in_the_matrix__arena.yaml │ │ ├── prisoners_dilemma_in_the_matrix__repeated.yaml │ │ ├── pure_coordination_in_the_matrix__arena.yaml │ │ ├── pure_coordination_in_the_matrix__repeated.yaml │ │ ├── rationalizable_coordination_in_the_matrix__arena.yaml │ │ ├── rationalizable_coordination_in_the_matrix__repeated.yaml │ │ ├── running_with_scissors_in_the_matrix__arena.yaml │ │ ├── running_with_scissors_in_the_matrix__one_shot.yaml │ │ ├── running_with_scissors_in_the_matrix__repeated.yaml │ │ ├── stag_hunt_in_the_matrix__arena.yaml │ │ ├── stag_hunt_in_the_matrix__repeated.yaml │ │ ├── territory__inside_out.yaml │ │ ├── territory__open.yaml │ │ └── territory__rooms.yaml │ │ ├── pettingzoo │ │ ├── multiwalker.yaml │ │ ├── simple_adversary.yaml │ │ ├── simple_crypto.yaml │ │ ├── simple_push.yaml │ │ ├── simple_reference.yaml │ │ ├── simple_speaker_listener.yaml │ │ ├── simple_spread.yaml │ │ ├── simple_tag.yaml │ │ ├── simple_world_comm.yaml │ │ └── waterworld.yaml │ │ ├── smacv2 │ │ ├── protoss_10_vs_10.yaml │ │ ├── protoss_10_vs_11.yaml │ │ ├── protoss_20_vs_20.yaml │ │ ├── protoss_20_vs_23.yaml │ │ ├── protoss_5_vs_5.yaml │ │ ├── terran_10_vs_10.yaml │ │ ├── terran_10_vs_11.yaml │ │ ├── terran_20_vs_20.yaml │ │ ├── terran_20_vs_23.yaml │ │ ├── terran_5_vs_5.yaml │ │ ├── zerg_10_vs_10.yaml │ │ ├── zerg_10_vs_11.yaml │ │ ├── zerg_20_vs_20.yaml │ │ ├── zerg_20_vs_23.yaml │ │ └── zerg_5_vs_5.yaml │ │ └── vmas │ │ ├── balance.yaml │ │ ├── ball_passage.yaml │ │ ├── ball_trajectory.yaml │ │ ├── buzz_wire.yaml │ │ ├── discovery.yaml │ │ ├── dispersion.yaml │ │ ├── dropout.yaml │ │ ├── flocking.yaml │ │ ├── football.yaml │ │ ├── give_way.yaml │ │ ├── joint_passage.yaml │ │ ├── joint_passage_size.yaml │ │ ├── multi_give_way.yaml │ │ ├── navigation.yaml │ │ ├── passage.yaml │ │ ├── reverse_transport.yaml │ │ ├── sampling.yaml │ │ ├── simple_adversary.yaml │ │ ├── simple_crypto.yaml │ │ ├── simple_push.yaml │ │ ├── simple_reference.yaml │ │ ├── simple_speaker_listener.yaml │ │ ├── simple_spread.yaml │ │ ├── simple_tag.yaml │ │ ├── simple_world_comm.yaml │ │ ├── transport.yaml │ │ ├── wheel.yaml │ │ └── wind_flocking.yaml ├── environments │ ├── __init__.py │ ├── common.py │ ├── magent │ │ ├── __init__.py │ │ ├── adversarial_pursuit.py │ │ └── common.py │ ├── meltingpot │ │ ├── __init__.py │ │ └── common.py │ ├── pettingzoo │ │ ├── __init__.py │ │ ├── common.py │ │ ├── multiwalker.py │ │ ├── simple_adversary.py │ │ ├── simple_crypto.py │ │ ├── simple_push.py │ │ ├── simple_reference.py │ │ ├── simple_speaker_listener.py │ │ ├── simple_spread.py │ │ ├── simple_tag.py │ │ ├── simple_world_comm.py │ │ └── waterworld.py │ ├── smacv2 │ │ ├── __init__.py │ │ └── common.py │ └── vmas │ │ ├── __init__.py │ │ ├── balance.py │ │ ├── ball_passage.py │ │ ├── ball_trajectory.py │ │ ├── buzz_wire.py │ │ ├── common.py │ │ ├── discovery.py │ │ ├── dispersion.py │ │ ├── dropout.py │ │ ├── flocking.py │ │ ├── football.py │ │ ├── give_way.py │ │ ├── joint_passage.py │ │ ├── joint_passage_size.py │ │ ├── multi_give_way.py │ │ ├── navigation.py │ │ ├── passage.py │ │ ├── reverse_transport.py │ │ ├── sampling.py │ │ ├── simple_adversary.py │ │ ├── simple_crypto.py │ │ ├── simple_push.py │ │ ├── simple_reference.py │ │ ├── simple_speaker_listener.py │ │ ├── simple_spread.py │ │ ├── simple_tag.py │ │ ├── simple_world_comm.py │ │ ├── transport.py │ │ ├── wheel.py │ │ └── wind_flocking.py ├── eval_results.py ├── evaluate.py ├── experiment │ ├── __init__.py │ ├── callback.py │ ├── experiment.py │ └── logger.py ├── hydra_config.py ├── models │ ├── __init__.py │ ├── cnn.py │ ├── common.py │ ├── deepsets.py │ ├── gnn.py │ ├── gru.py │ ├── lstm.py │ └── mlp.py ├── resume.py ├── run.py └── utils.py ├── docs ├── Makefile ├── make.bat ├── requirements.txt └── source │ ├── _static │ └── js │ │ └── version_alert.js │ ├── _templates │ ├── autosummary │ │ ├── class.rst │ │ ├── class_no_inherit.rst │ │ ├── class_no_undoc.rst │ │ ├── class_private.rst │ │ └── class_private_no_undoc.rst │ └── breadcrumbs.html │ ├── concepts │ ├── benchmarks.rst │ ├── components.rst │ ├── configuring.rst │ ├── extending.rst │ ├── features.rst │ └── reporting.rst │ ├── conf.py │ ├── index.rst │ ├── modules │ ├── algorithms.rst │ ├── benchmark.rst │ ├── environments.rst │ ├── experiment.rst │ ├── models.rst │ └── root.rst │ └── usage │ ├── citing.rst │ ├── installation.rst │ ├── notebooks.rst │ └── running.rst ├── examples ├── callback │ └── custom_callback.py ├── checkpointing │ ├── reload_experiment.py │ ├── reload_experiment.sh │ ├── resume_experiment.py │ └── resume_experiment.sh ├── configuring │ ├── configuring_algorithm.py │ ├── configuring_algorithm.sh │ ├── configuring_experiment.py │ ├── configuring_experiment.sh │ ├── configuring_model.py │ ├── configuring_model.sh │ ├── configuring_sequence_model.py │ ├── configuring_sequence_model.sh │ ├── configuring_task.py │ └── configuring_task.sh ├── ensemble │ ├── README.md │ ├── ensemble_algorithm.py │ ├── ensemble_algorithm_and_model.py │ └── ensemble_model.py ├── evaluating │ ├── evalaute_experiment.py │ └── evaluate_experiment.sh ├── extending │ ├── algorithm │ │ ├── README.md │ │ ├── algorithms │ │ │ └── customalgorithm.py │ │ └── conf │ │ │ └── algorithm │ │ │ └── customalgorithm.yaml │ ├── model │ │ ├── README.md │ │ ├── conf │ │ │ └── model │ │ │ │ └── layers │ │ │ │ └── custommodel.yaml │ │ └── models │ │ │ └── custommodel.py │ └── task │ │ ├── README.md │ │ ├── conf │ │ └── task │ │ │ └── customenv │ │ │ ├── task_1.yaml │ │ │ └── task_2.yaml │ │ └── environments │ │ └── customenv │ │ ├── common.py │ │ └── task_1.py ├── plotting │ ├── README.md │ └── plot_benchmark.py ├── running │ ├── run_benchmark.py │ ├── run_benchmark.sh │ ├── run_experiment.py │ └── run_experiment.sh └── sweep │ └── wandb │ ├── readme.md │ └── sweepconfig.yaml ├── fine_tuned ├── smacv2 │ ├── conf │ │ └── config.yaml │ └── smacv2_run.py └── vmas │ ├── conf │ └── config.yaml │ └── vmas_run.py ├── notebooks └── run.ipynb ├── pyproject.toml ├── setup.cfg ├── setup.py └── test ├── conftest.py ├── test_algorithm.py ├── test_magent.py ├── test_meltingpot.py ├── test_models.py ├── test_pettingzoo.py ├── test_smacv2.py ├── test_task.py ├── test_vmas.py ├── utils.py └── utils_experiment.py /.github/unittest/install_dependencies.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | python -m pip install --upgrade pip 4 | python -m pip install flake8 pytest pytest-cov hydra-core tqdm 5 | python -m pip install torchrl 6 | python -m pip install torch_geometric torchvision "av<14" 7 | 8 | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 9 | 10 | cd ../BenchMARL 11 | pip install -e . 12 | -------------------------------------------------------------------------------- /.github/unittest/install_dependencies_nightly.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | python -m pip install --upgrade pip 4 | python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch_geometric 5 | 6 | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 7 | 8 | python -m pip install torch torchvision "av<14" 9 | # Not using nightly torch 10 | # python -m pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall 11 | 12 | cd ../BenchMARL 13 | pip install -e . 14 | 15 | pip uninstall --yes torchrl tensordict 16 | 17 | cd .. 18 | 19 | # install cmake 20 | conda install anaconda::cmake -y 21 | python -m pip install "pybind11[global]" 22 | 23 | pip install git+https://github.com/pytorch/tensordict.git 24 | pip install git+https://github.com/pytorch/rl.git 25 | -------------------------------------------------------------------------------- /.github/unittest/install_magent2.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | # pip install git+https://github.com/Farama-Foundation/MAgent2 temporary TODO wait for fix 4 | pip install git+https://github.com/Farama-Foundation/MAgent2@9706565fab98ae3dc90dc13b40569a392bf589aa 5 | 6 | sudo apt-get update 7 | sudo apt-get install python3-opengl xvfb 8 | -------------------------------------------------------------------------------- /.github/unittest/install_meltingpot.sh: -------------------------------------------------------------------------------- 1 | 2 | pip install dm-meltingpot 3 | -------------------------------------------------------------------------------- /.github/unittest/install_pettingzoo.sh: -------------------------------------------------------------------------------- 1 | 2 | pip install "pettingzoo[mpe,sisl]==1.24.3" 3 | sudo apt-get update 4 | sudo apt-get install python3-opengl xvfb 5 | -------------------------------------------------------------------------------- /.github/unittest/install_smacv2.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | root_dir="$(git rev-parse --show-toplevel)" 4 | cd "${root_dir}" 5 | 6 | starcraft_path="${root_dir}/StarCraftII" 7 | map_dir="${starcraft_path}/Maps" 8 | printf "* Installing StarCraft 2 and SMACv2 maps into ${starcraft_path}\n" 9 | cd "${root_dir}" 10 | wget https://blzdistsc2-a.akamaihd.net/Linux/SC2.4.10.zip 11 | # The archive contains StarCraftII folder. Password comes from the documentation. 12 | unzip -qo -P iagreetotheeula SC2.4.10.zip 13 | mkdir -p "${map_dir}" 14 | # Install Maps 15 | wget https://github.com/oxwhirl/smacv2/releases/download/maps/SMAC_Maps.zip 16 | unzip SMAC_Maps.zip 17 | mkdir "${map_dir}/SMAC_Maps" 18 | mv *.SC2Map "${map_dir}/SMAC_Maps" 19 | printf "StarCraft II and SMAC are installed." 20 | 21 | pip install git+https://github.com/oxwhirl/smacv2.git 22 | -------------------------------------------------------------------------------- /.github/unittest/install_vmas.sh: -------------------------------------------------------------------------------- 1 | 2 | python -m pip install vmas matplotlib==3.8 3 | sudo apt-get update 4 | sudo apt-get install python3-opengl xvfb 5 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python 2 | # For more information see: 3 | # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 4 | 5 | 6 | name: lint 7 | 8 | on: 9 | push: 10 | branches: [ $default-branch , "main" ] 11 | pull_request: 12 | branches: [ $default-branch , "main" ] 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | build: 19 | runs-on: ubuntu-latest 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | python-version: ["3.11"] 24 | 25 | steps: 26 | - uses: actions/checkout@v3 27 | - name: Set up Python ${{ matrix.python-version }} 28 | uses: actions/setup-python@v3 29 | with: 30 | python-version: ${{ matrix.python-version }} 31 | 32 | - name: Lint 33 | run: | 34 | python -m pip install --upgrade pip 35 | pip install pre-commit 36 | 37 | set +e 38 | pre-commit run --all-files 39 | 40 | if [ $? -ne 0 ]; then 41 | git --no-pager diff 42 | exit 1 43 | fi 44 | 45 | 46 | -------------------------------------------------------------------------------- /.github/workflows/magent_tests.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python 2 | # For more information see: 3 | # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 4 | 5 | 6 | name: magent_tests 7 | 8 | on: 9 | push: 10 | branches: [ $default-branch , "main" ] 11 | pull_request: 12 | branches: [ $default-branch , "main" ] 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | tests: 19 | runs-on: ubuntu-latest 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | python-version: ["3.11"] 24 | 25 | steps: 26 | - uses: actions/checkout@v3 27 | - name: Set up Python ${{ matrix.python-version }} 28 | uses: actions/setup-python@v3 29 | with: 30 | python-version: ${{ matrix.python-version }} 31 | - name: Install dependencies 32 | run: | 33 | bash .github/unittest/install_dependencies_nightly.sh 34 | - name: Install magent2 35 | run: | 36 | bash .github/unittest/install_magent2.sh 37 | - name: Test with pytest 38 | run: | 39 | xvfb-run -s "-screen 0 1024x768x24" pytest test/test_magent.py --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html 40 | - name: Upload coverage to Codecov 41 | uses: codecov/codecov-action@v3 42 | with: 43 | fail_ci_if_error: false 44 | -------------------------------------------------------------------------------- /.github/workflows/meltingpot_tests.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python 2 | # For more information see: 3 | # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 4 | 5 | 6 | name: meltingpot_tests 7 | 8 | on: 9 | push: 10 | branches: [ $default-branch , "main" ] 11 | pull_request: 12 | branches: [ $default-branch , "main" ] 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | tests: 19 | runs-on: ubuntu-latest 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | python-version: ["3.11"] 24 | 25 | steps: 26 | - uses: actions/checkout@v3 27 | - name: Set up Python ${{ matrix.python-version }} 28 | uses: actions/setup-python@v3 29 | with: 30 | python-version: ${{ matrix.python-version }} 31 | - name: Install dependencies 32 | run: | 33 | bash .github/unittest/install_dependencies_nightly.sh 34 | - name: Install meltingpot 35 | run: | 36 | bash .github/unittest/install_meltingpot.sh 37 | - name: Test with pytest 38 | run: | 39 | pytest test/test_meltingpot.py --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html 40 | - name: Upload coverage to Codecov 41 | uses: codecov/codecov-action@v3 42 | with: 43 | fail_ci_if_error: false 44 | -------------------------------------------------------------------------------- /.github/workflows/pettingzoo_tests.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python 2 | # For more information see: 3 | # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 4 | 5 | 6 | name: pettingzoo_tests 7 | 8 | on: 9 | push: 10 | branches: [ $default-branch , "main" ] 11 | pull_request: 12 | branches: [ $default-branch , "main" ] 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | tests: 19 | runs-on: ubuntu-latest 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | python-version: ["3.11"] 24 | 25 | steps: 26 | - uses: actions/checkout@v3 27 | - name: Set up Python ${{ matrix.python-version }} 28 | uses: actions/setup-python@v3 29 | with: 30 | python-version: ${{ matrix.python-version }} 31 | - name: Install dependencies 32 | run: | 33 | bash .github/unittest/install_dependencies_nightly.sh 34 | - name: Install pettingzoo 35 | run: | 36 | bash .github/unittest/install_pettingzoo.sh 37 | - name: Test with pytest 38 | run: | 39 | xvfb-run -s "-screen 0 1024x768x24" pytest test/test_pettingzoo.py --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html 40 | - name: Upload coverage to Codecov 41 | uses: codecov/codecov-action@v3 42 | with: 43 | fail_ci_if_error: false 44 | -------------------------------------------------------------------------------- /.github/workflows/smacv2_tests.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python 2 | # For more information see: 3 | # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 4 | 5 | 6 | name: smacv2_tests 7 | 8 | on: 9 | push: 10 | branches: [ $default-branch , "main" ] 11 | pull_request: 12 | branches: [ $default-branch , "main" ] 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | tests: 19 | if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'smacv2') }} 20 | runs-on: ubuntu-latest 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | python-version: ["3.10"] 25 | 26 | steps: 27 | - uses: actions/checkout@v3 28 | - name: Set up Python ${{ matrix.python-version }} 29 | uses: actions/setup-python@v3 30 | with: 31 | python-version: ${{ matrix.python-version }} 32 | - name: Install dependencies 33 | run: | 34 | bash .github/unittest/install_dependencies_nightly.sh 35 | - name: Install smacv2 36 | run: | 37 | bash .github/unittest/install_smacv2.sh 38 | 39 | - name: Test with pytest 40 | run: | 41 | root_dir="$(git rev-parse --show-toplevel)" 42 | export SC2PATH="${root_dir}/StarCraftII" 43 | echo 'SC2PATH is set to ' "$SC2PATH" 44 | 45 | pytest test/test_smacv2.py --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html 46 | 47 | - name: Upload coverage to Codecov 48 | uses: codecov/codecov-action@v3 49 | with: 50 | fail_ci_if_error: false 51 | -------------------------------------------------------------------------------- /.github/workflows/torchrl_stable_tests.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python 2 | # For more information see: 3 | # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 4 | 5 | 6 | name: torchrl_stable_tests 7 | 8 | on: 9 | push: 10 | branches: [ $default-branch , "main" ] 11 | pull_request: 12 | branches: [ $default-branch , "main" ] 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | tests: 19 | runs-on: ubuntu-latest 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | python-version: ["3.11"] 24 | steps: 25 | - uses: actions/checkout@v3 26 | - name: Set up Python ${{ matrix.python-version }} 27 | uses: actions/setup-python@v3 28 | with: 29 | python-version: ${{ matrix.python-version }} 30 | - name: Install dependencies 31 | run: | 32 | bash .github/unittest/install_dependencies.sh 33 | - name: Install vmas 34 | run: | 35 | bash .github/unittest/install_vmas.sh 36 | - name: Install pettingzoo 37 | run: | 38 | bash .github/unittest/install_pettingzoo.sh 39 | - name: Install meltingpot 40 | run: | 41 | bash .github/unittest/install_meltingpot.sh 42 | - name: Tests 43 | run: | 44 | xvfb-run -s "-screen 0 1024x768x24" pytest test/test_algorithm.py test/test_models.py test/test_task.py test/test_pettingzoo.py test/test_vmas.py test/test_meltingpot.py --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html 45 | -------------------------------------------------------------------------------- /.github/workflows/unit_tests.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python 2 | # For more information see: 3 | # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 4 | 5 | 6 | name: unit_tests 7 | 8 | on: 9 | push: 10 | branches: [ $default-branch , "main" ] 11 | pull_request: 12 | branches: [ $default-branch , "main" ] 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | tests: 19 | runs-on: ${{ matrix.os }} 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | python-version: ["3.9", "3.10","3.11"] 24 | os: [ubuntu-latest, windows-latest, macos-15] 25 | steps: 26 | - uses: actions/checkout@v3 27 | - name: Set up Python ${{ matrix.python-version }} 28 | uses: actions/setup-python@v3 29 | with: 30 | python-version: ${{ matrix.python-version }} 31 | - name: Install dependencies 32 | run: | 33 | bash .github/unittest/install_dependencies_nightly.sh 34 | 35 | - name: Test with pytest 36 | run: | 37 | pytest test/ --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html 38 | 39 | - if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' 40 | name: Upload coverage to Codecov 41 | uses: codecov/codecov-action@v3 42 | with: 43 | fail_ci_if_error: false 44 | -------------------------------------------------------------------------------- /.github/workflows/vmas_tests.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python 2 | # For more information see: 3 | # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 4 | 5 | 6 | name: vmas_tests 7 | 8 | on: 9 | push: 10 | branches: [ $default-branch , "main" ] 11 | pull_request: 12 | branches: [ $default-branch , "main" ] 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | tests: 19 | runs-on: ubuntu-latest 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | python-version: ["3.11"] 24 | 25 | steps: 26 | - uses: actions/checkout@v3 27 | - name: Set up Python ${{ matrix.python-version }} 28 | uses: actions/setup-python@v3 29 | with: 30 | python-version: ${{ matrix.python-version }} 31 | - name: Install dependencies 32 | run: | 33 | bash .github/unittest/install_dependencies_nightly.sh 34 | - name: Install vmas 35 | run: | 36 | bash .github/unittest/install_vmas.sh 37 | - name: Test with pytest 38 | run: | 39 | xvfb-run -s "-screen 0 1024x768x24" pytest test/test_vmas.py --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html 40 | 41 | - name: Upload coverage to Codecov 42 | uses: codecov/codecov-action@v3 43 | with: 44 | fail_ci_if_error: false 45 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/pre-commit-hooks 3 | rev: v4.0.1 4 | hooks: 5 | - id: check-docstring-first 6 | - id: check-toml 7 | - id: check-yaml 8 | exclude: packaging/.* 9 | - id: mixed-line-ending 10 | args: [--fix=lf] 11 | - id: end-of-file-fixer 12 | 13 | - repo: https://github.com/omnilib/ufmt 14 | rev: v2.0.0b2 15 | hooks: 16 | - id: ufmt 17 | additional_dependencies: 18 | - black == 22.3.0 19 | - usort == 1.0.3 20 | - libcst == 0.4.7 21 | 22 | - repo: https://github.com/pycqa/flake8 23 | rev: 4.0.1 24 | hooks: 25 | - id: flake8 26 | args: [--config=setup.cfg] 27 | additional_dependencies: 28 | - flake8-bugbear==22.10.27 29 | - flake8-comprehensions==3.10.1 30 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the OS, Python version and other tools you might need 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.10" 13 | 14 | # Build documentation in the "docs/" directory with Sphinx 15 | sphinx: 16 | fail_on_warning: true 17 | configuration: docs/source/conf.py 18 | 19 | # Optionally build your docs in additional formats such as PDF and ePub 20 | formats: 21 | - epub 22 | 23 | # Optional but recommended, declare the Python requirements required 24 | # to build your documentation 25 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 26 | python: 27 | install: 28 | - requirements: docs/requirements.txt 29 | # Install our python package before building the docs 30 | - method: pip 31 | path: . 32 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: If you use this software, please cite it as below. 3 | type: software 4 | title: "BenchMARL" 5 | authors: 6 | - family-names: BenchMARL team 7 | url: "https://github.com/facebookresearch/BenchMARL" 8 | preferred-citation: 9 | type: article 10 | title: "BenchMARL: Benchmarking Multi-Agent Reinforcement Learning" 11 | authors: 12 | - family-names: Bettini 13 | given-names: Matteo 14 | - family-names: Prorok 15 | given-names: Amanda 16 | - family-names: Moens 17 | given-names: Vincent 18 | journal: "arXiv preprint arXiv:2312.01472" 19 | year: 2023 20 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to BenchMARL 2 | We want to make contributing to this project as easy and transparent as 3 | possible. 4 | 5 | **We have an open issue listing all the features we would like to integrate in the library, 6 | this is a very good starting point for contributing!** 7 | 8 | ## Pull Requests 9 | We actively welcome your pull requests. 10 | 11 | 1. Fork the repo and create your branch from `main`. 12 | 2. If you've added code that should be tested, add tests. 13 | 3. If you've changed APIs, update the documentation. 14 | 4. Ensure the test suite passes. 15 | 5. Make sure your code lints. 16 | 6. If you haven't already, complete the Contributor License Agreement ("CLA"). 17 | 18 | ## Contributor License Agreement ("CLA") 19 | In order to accept your pull request, we need you to submit a CLA. You only need 20 | to do this once to work on any of Facebook's open source projects. 21 | 22 | Complete your CLA here: 23 | 24 | ## Issues 25 | We use GitHub issues to track public bugs. Please ensure your description is 26 | clear and has sufficient instructions to be able to reproduce the issue. 27 | 28 | Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe 29 | disclosure of security bugs. In those cases, please go through the process 30 | outlined on that page and do not file a public issue. 31 | 32 | ## License 33 | By contributing to BenchMARL, you agree that your contributions will be licensed 34 | under the LICENSE file in the root directory of this source tree. 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Meta Platforms, Inc. and affiliates. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /benchmarl/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | 8 | __version__ = "1.5.0" 9 | 10 | import importlib 11 | 12 | import benchmarl.algorithms 13 | import benchmarl.benchmark 14 | import benchmarl.environments 15 | import benchmarl.experiment 16 | import benchmarl.models 17 | 18 | _has_hydra = importlib.util.find_spec("hydra") is not None 19 | 20 | if _has_hydra: 21 | 22 | def _load_hydra_schemas(): 23 | from hydra.core.config_store import ConfigStore 24 | 25 | from benchmarl.algorithms import algorithm_config_registry 26 | from benchmarl.environments import _task_class_registry 27 | from benchmarl.experiment import ExperimentConfig 28 | 29 | # Create instance to load hydra schemas 30 | cs = ConfigStore.instance() 31 | # Load experiment schema 32 | cs.store(name="experiment_config", group="experiment", node=ExperimentConfig) 33 | # Load algos schemas 34 | for algo_name, algo_schema in algorithm_config_registry.items(): 35 | cs.store(name=f"{algo_name}_config", group="algorithm", node=algo_schema) 36 | # Load task schemas 37 | for task_schema_name, task_schema in _task_class_registry.items(): 38 | cs.store(name=f"{task_schema_name}_config", group="task", node=task_schema) 39 | 40 | _load_hydra_schemas() 41 | -------------------------------------------------------------------------------- /benchmarl/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from .common import Algorithm, AlgorithmConfig 8 | from .ensemble import EnsembleAlgorithm, EnsembleAlgorithmConfig 9 | from .iddpg import Iddpg, IddpgConfig 10 | from .ippo import Ippo, IppoConfig 11 | from .iql import Iql, IqlConfig 12 | from .isac import Isac, IsacConfig 13 | from .maddpg import Maddpg, MaddpgConfig 14 | from .mappo import Mappo, MappoConfig 15 | from .masac import Masac, MasacConfig 16 | from .qmix import Qmix, QmixConfig 17 | from .vdn import Vdn, VdnConfig 18 | 19 | classes = [ 20 | "Iddpg", 21 | "IddpgConfig", 22 | "Ippo", 23 | "IppoConfig", 24 | "Iql", 25 | "IqlConfig", 26 | "Isac", 27 | "IsacConfig", 28 | "Maddpg", 29 | "MaddpgConfig", 30 | "Mappo", 31 | "MappoConfig", 32 | "Masac", 33 | "MasacConfig", 34 | "Qmix", 35 | "QmixConfig", 36 | "Vdn", 37 | "VdnConfig", 38 | ] 39 | 40 | # A registry mapping "algoname" to its config dataclass 41 | # This is used to aid loading of algorithms from yaml 42 | algorithm_config_registry = { 43 | "mappo": MappoConfig, 44 | "ippo": IppoConfig, 45 | "maddpg": MaddpgConfig, 46 | "iddpg": IddpgConfig, 47 | "masac": MasacConfig, 48 | "isac": IsacConfig, 49 | "qmix": QmixConfig, 50 | "vdn": VdnConfig, 51 | "iql": IqlConfig, 52 | } 53 | -------------------------------------------------------------------------------- /benchmarl/benchmark/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from .benchmark import Benchmark 8 | -------------------------------------------------------------------------------- /benchmarl/benchmark/benchmark.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from typing import Iterator, Optional, Sequence, Set, Union 8 | 9 | from benchmarl.algorithms.common import AlgorithmConfig 10 | from benchmarl.environments import Task, TaskClass 11 | from benchmarl.experiment import Experiment, ExperimentConfig 12 | from benchmarl.models.common import ModelConfig 13 | 14 | 15 | class Benchmark: 16 | """A benchmark. 17 | 18 | Benchmarks are collections of experiments to compare. 19 | 20 | Args: 21 | algorithm_configs (sequence of AlgorithmConfig): the algorithms to benchmark 22 | model_config (ModelConfig): the config of the policy model 23 | tasks (sequence of Task): the tasks to benchmark 24 | seeds (set of int): the seeds for the benchmark 25 | experiment_config (ExperimentConfig): the experiment config 26 | critic_model_config (ModelConfig, optional): the config of the critic model. Defaults to model_config 27 | 28 | """ 29 | 30 | def __init__( 31 | self, 32 | algorithm_configs: Sequence[AlgorithmConfig], 33 | model_config: ModelConfig, 34 | tasks: Sequence[Union[Task, TaskClass]], 35 | seeds: Set[int], 36 | experiment_config: ExperimentConfig, 37 | critic_model_config: Optional[ModelConfig] = None, 38 | ): 39 | self.algorithm_configs = algorithm_configs 40 | self.tasks = tasks 41 | self.seeds = seeds 42 | 43 | self.model_config = model_config 44 | self.critic_model_config = ( 45 | critic_model_config if critic_model_config is not None else model_config 46 | ) 47 | self.experiment_config = experiment_config 48 | 49 | print(f"Created benchmark with {self.n_experiments} experiments.") 50 | 51 | @property 52 | def n_experiments(self): 53 | """The number of experiments in the benchmark.""" 54 | return len(self.algorithm_configs) * len(self.tasks) * len(self.seeds) 55 | 56 | def get_experiments(self) -> Iterator[Experiment]: 57 | """Yields one experiment at a time""" 58 | for algorithm_config in self.algorithm_configs: 59 | for task in self.tasks: 60 | for seed in self.seeds: 61 | yield Experiment( 62 | task=task, 63 | algorithm_config=algorithm_config, 64 | seed=seed, 65 | model_config=self.model_config, 66 | critic_model_config=self.critic_model_config, 67 | config=self.experiment_config, 68 | ) 69 | 70 | def run_sequential(self): 71 | """Run all the experiments in the benchmark in a sequence.""" 72 | for i, experiment in enumerate(self.get_experiments()): 73 | print(f"\nRunning experiment {i+1}/{self.n_experiments}.\n") 74 | try: 75 | experiment.run() 76 | except KeyboardInterrupt as interrupt: 77 | print("\n\nBenchmark was closed gracefully\n\n") 78 | experiment.close() 79 | raise interrupt 80 | -------------------------------------------------------------------------------- /benchmarl/conf/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | -------------------------------------------------------------------------------- /benchmarl/conf/algorithm/iddpg.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - iddpg_config 3 | - _self_ 4 | 5 | 6 | share_param_critic: True 7 | loss_function: "l2" 8 | delay_value: True 9 | use_tanh_mapping: True 10 | -------------------------------------------------------------------------------- /benchmarl/conf/algorithm/ippo.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - ippo_config 3 | - _self_ 4 | 5 | 6 | share_param_critic: True 7 | clip_epsilon: 0.2 8 | entropy_coef: 0.0 9 | critic_coef: 1.0 10 | loss_critic_type: "l2" 11 | lmbda: 0.9 12 | scale_mapping: "biased_softplus_1.0" 13 | use_tanh_normal: True 14 | minibatch_advantage: False 15 | -------------------------------------------------------------------------------- /benchmarl/conf/algorithm/iql.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - iql_config 3 | - _self_ 4 | 5 | 6 | delay_value: True 7 | loss_function: "l2" 8 | -------------------------------------------------------------------------------- /benchmarl/conf/algorithm/isac.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - isac_config 3 | - _self_ 4 | 5 | 6 | share_param_critic: True 7 | num_qvalue_nets: 2 8 | loss_function: "l2" 9 | delay_qvalue: True 10 | target_entropy: "auto" 11 | discrete_target_entropy_weight: 0.2 12 | alpha_init: 1.0 13 | min_alpha: null 14 | max_alpha: null 15 | fixed_alpha: False 16 | scale_mapping: "biased_softplus_1.0" 17 | use_tanh_normal: True 18 | -------------------------------------------------------------------------------- /benchmarl/conf/algorithm/maddpg.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - maddpg_config 3 | - _self_ 4 | 5 | 6 | share_param_critic: True 7 | loss_function: "l2" 8 | delay_value: True 9 | use_tanh_mapping: True 10 | -------------------------------------------------------------------------------- /benchmarl/conf/algorithm/mappo.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - mappo_config 3 | - _self_ 4 | 5 | 6 | 7 | share_param_critic: True 8 | clip_epsilon: 0.2 9 | entropy_coef: 0.0 10 | critic_coef: 1.0 11 | loss_critic_type: "l2" 12 | lmbda: 0.9 13 | scale_mapping: "biased_softplus_1.0" 14 | use_tanh_normal: True 15 | minibatch_advantage: False 16 | -------------------------------------------------------------------------------- /benchmarl/conf/algorithm/masac.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - masac_config 3 | - _self_ 4 | 5 | share_param_critic: True 6 | num_qvalue_nets: 2 7 | loss_function: "l2" 8 | delay_qvalue: True 9 | target_entropy: "auto" 10 | discrete_target_entropy_weight: 0.2 11 | alpha_init: 1.0 12 | min_alpha: null 13 | max_alpha: null 14 | fixed_alpha: False 15 | scale_mapping: "biased_softplus_1.0" 16 | use_tanh_normal: True 17 | coupled_discrete_values: True 18 | -------------------------------------------------------------------------------- /benchmarl/conf/algorithm/qmix.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - qmix_config 3 | - _self_ 4 | 5 | 6 | mixing_embed_dim: 32 7 | delay_value: True 8 | loss_function: "l2" 9 | -------------------------------------------------------------------------------- /benchmarl/conf/algorithm/vdn.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vdn_config 3 | - _self_ 4 | 5 | delay_value: True 6 | loss_function: "l2" 7 | -------------------------------------------------------------------------------- /benchmarl/conf/config.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - experiment: base_experiment 3 | - algorithm: ??? 4 | - task: ??? 5 | - model: layers/mlp 6 | - model@critic_model: layers/mlp 7 | - _self_ 8 | 9 | seed: 0 10 | -------------------------------------------------------------------------------- /benchmarl/conf/model/layers/cnn.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: cnn 3 | 4 | mlp_num_cells: [32] 5 | mlp_layer_class: torch.nn.Linear 6 | mlp_activation_class: torch.nn.Tanh 7 | mlp_activation_kwargs: null 8 | mlp_norm_class: null 9 | mlp_norm_kwargs: null 10 | 11 | cnn_num_cells: [32, 32, 32] 12 | cnn_kernel_sizes: 3 13 | cnn_strides: 1 14 | cnn_paddings: 0 15 | cnn_activation_class: torch.nn.Tanh 16 | cnn_activation_kwargs: null 17 | cnn_norm_class: null 18 | cnn_norm_kwargs: null 19 | -------------------------------------------------------------------------------- /benchmarl/conf/model/layers/deepsets.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: deepsets 3 | 4 | aggr: "sum" 5 | local_nn_num_cells: [128, 128] 6 | local_nn_activation_class: torch.nn.Tanh 7 | out_features_local_nn: 256 8 | global_nn_num_cells: [256, 256] 9 | global_nn_activation_class: torch.nn.Tanh 10 | -------------------------------------------------------------------------------- /benchmarl/conf/model/layers/gnn.yaml: -------------------------------------------------------------------------------- 1 | name: gnn 2 | 3 | topology: full 4 | self_loops: False 5 | 6 | gnn_class: torch_geometric.nn.conv.GraphConv 7 | gnn_kwargs: 8 | aggr: "add" 9 | 10 | position_key: null 11 | pos_features: 0 12 | velocity_key: null 13 | vel_features: 0 14 | 15 | exclude_pos_from_node_features: False 16 | edge_radius: null 17 | -------------------------------------------------------------------------------- /benchmarl/conf/model/layers/gru.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: gru 3 | 4 | hidden_size: 128 5 | n_layers: 1 6 | bias: True 7 | dropout: 0 8 | compile: False 9 | 10 | mlp_num_cells: [256, 256] 11 | mlp_layer_class: torch.nn.Linear 12 | mlp_activation_class: torch.nn.Tanh 13 | mlp_activation_kwargs: null 14 | mlp_norm_class: null 15 | mlp_norm_kwargs: null 16 | -------------------------------------------------------------------------------- /benchmarl/conf/model/layers/lstm.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: lstm 3 | 4 | hidden_size: 128 5 | n_layers: 1 6 | bias: True 7 | dropout: 0 8 | compile: False 9 | 10 | mlp_num_cells: [256, 256] 11 | mlp_layer_class: torch.nn.Linear 12 | mlp_activation_class: torch.nn.Tanh 13 | mlp_activation_kwargs: null 14 | mlp_norm_class: null 15 | mlp_norm_kwargs: null 16 | -------------------------------------------------------------------------------- /benchmarl/conf/model/layers/mlp.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: mlp 3 | 4 | num_cells: [256, 256] 5 | layer_class: torch.nn.Linear 6 | 7 | activation_class: torch.nn.Tanh 8 | activation_kwargs: null 9 | 10 | norm_class: null 11 | norm_kwargs: null 12 | -------------------------------------------------------------------------------- /benchmarl/conf/model/sequence.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | # Here is a list of layers for this model 3 | # You can use configs from the "layers" folder 4 | - layers@layers.l1: ??? # Example -> mlp 5 | - layers@layers.l2: ??? # Example -> mlp 6 | - _self_ 7 | 8 | # A list of ints for the intermediate sizes between layers 9 | # Should be of length = num_layers - 1 10 | intermediate_sizes: ??? # Example -> [256] 11 | 12 | # You can override your layers for example like this 13 | # layers: 14 | # l1: 15 | # num_cells: [4] 16 | -------------------------------------------------------------------------------- /benchmarl/conf/task/magent/adversarial_pursuit.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - magent_adversarial_pursuit_config 3 | - _self_ 4 | 5 | map_size: 45 6 | minimap_mode: False 7 | tag_penalty: -0.2 8 | max_cycles: 500 9 | extra_features: False 10 | -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/allelopathic_harvest__open.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/allelopathic_harvest__open.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/bach_or_stravinsky_in_the_matrix__arena.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/bach_or_stravinsky_in_the_matrix__arena.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/bach_or_stravinsky_in_the_matrix__repeated.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/bach_or_stravinsky_in_the_matrix__repeated.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/boat_race__eight_races.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/boat_race__eight_races.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/chemistry__three_metabolic_cycles.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/chemistry__three_metabolic_cycles.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/chemistry__three_metabolic_cycles_with_plentiful_distractors.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/chemistry__three_metabolic_cycles_with_plentiful_distractors.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/chemistry__two_metabolic_cycles.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/chemistry__two_metabolic_cycles.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/chemistry__two_metabolic_cycles_with_distractors.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/chemistry__two_metabolic_cycles_with_distractors.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/chicken_in_the_matrix__arena.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/chicken_in_the_matrix__arena.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/chicken_in_the_matrix__repeated.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/chicken_in_the_matrix__repeated.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/clean_up.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/clean_up.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/coins.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/coins.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/collaborative_cooking__asymmetric.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/collaborative_cooking__asymmetric.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/collaborative_cooking__circuit.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/collaborative_cooking__circuit.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/collaborative_cooking__cramped.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/collaborative_cooking__cramped.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/collaborative_cooking__crowded.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/collaborative_cooking__crowded.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/collaborative_cooking__figure_eight.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/collaborative_cooking__figure_eight.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/collaborative_cooking__forced.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/collaborative_cooking__forced.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/collaborative_cooking__ring.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/collaborative_cooking__ring.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/commons_harvest__closed.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/commons_harvest__closed.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/commons_harvest__open.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/commons_harvest__open.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/commons_harvest__partnership.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/commons_harvest__partnership.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/coop_mining.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/coop_mining.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/daycare.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/daycare.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/externality_mushrooms__dense.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/externality_mushrooms__dense.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/factory_commons__either_or.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/factory_commons__either_or.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/fruit_market__concentric_rivers.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/fruit_market__concentric_rivers.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/gift_refinements.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/gift_refinements.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/hidden_agenda.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/hidden_agenda.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/paintball__capture_the_flag.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/paintball__capture_the_flag.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/paintball__king_of_the_hill.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/paintball__king_of_the_hill.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/predator_prey__alley_hunt.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/predator_prey__alley_hunt.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/predator_prey__open.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/predator_prey__open.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/predator_prey__orchard.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/predator_prey__orchard.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/predator_prey__random_forest.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/predator_prey__random_forest.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/prisoners_dilemma_in_the_matrix__arena.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/prisoners_dilemma_in_the_matrix__arena.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/prisoners_dilemma_in_the_matrix__repeated.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/prisoners_dilemma_in_the_matrix__repeated.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/pure_coordination_in_the_matrix__arena.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/pure_coordination_in_the_matrix__arena.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/pure_coordination_in_the_matrix__repeated.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/pure_coordination_in_the_matrix__repeated.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/rationalizable_coordination_in_the_matrix__arena.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/rationalizable_coordination_in_the_matrix__arena.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/rationalizable_coordination_in_the_matrix__repeated.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/rationalizable_coordination_in_the_matrix__repeated.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/running_with_scissors_in_the_matrix__arena.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/running_with_scissors_in_the_matrix__arena.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/running_with_scissors_in_the_matrix__one_shot.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/running_with_scissors_in_the_matrix__one_shot.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/running_with_scissors_in_the_matrix__repeated.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/running_with_scissors_in_the_matrix__repeated.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/stag_hunt_in_the_matrix__arena.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/stag_hunt_in_the_matrix__arena.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/stag_hunt_in_the_matrix__repeated.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/stag_hunt_in_the_matrix__repeated.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/territory__inside_out.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/territory__inside_out.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/territory__open.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/territory__open.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/meltingpot/territory__rooms.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/conf/task/meltingpot/territory__rooms.yaml -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/multiwalker.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_multiwalker_config 3 | - _self_ 4 | 5 | task: "multiwalker_v9" 6 | # number of bipedal walker agents in environment 7 | n_walkers: 3 8 | # whether reward is distributed among all agents or allocated individually 9 | shared_reward: False 10 | max_cycles: 500 11 | # noise applied to neighbors and package positional observations 12 | position_noise: 0.001 13 | # noise applied to neighbors and package rotational observations 14 | angle_noise: 0.001 15 | # reward received is forward_reward * change in position of the package 16 | forward_reward: 1.0 17 | # reward applied when an agent falls 18 | fall_reward: -10 19 | # reward applied to each walker if they fail to carry the package to the right edge of the terrain 20 | terminate_reward: -100 21 | # If True (default), a single walker falling causes all agents to be done, and they all receive an additional terminate_reward. If False, then only the fallen agent(s) receive fall_reward, and the rest of the agents are not done i.e. the environment continues. 22 | terminate_on_fall: true 23 | # Remove a walker when it falls (only works when terminate_on_fall is False) 24 | remove_on_fall: true 25 | # length of terrain in number of steps 26 | terrain_length: 200 27 | -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/simple_adversary.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_simple_adversary_config 3 | - _self_ 4 | 5 | 6 | task: "simple_adversary_v3" 7 | N: 2 8 | max_cycles: 100 9 | -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/simple_crypto.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_simple_crypto_config 3 | - _self_ 4 | 5 | 6 | task: "simple_crypto_v3" 7 | max_cycles: 100 8 | -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/simple_push.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_simple_push_config 3 | - _self_ 4 | 5 | 6 | task: "simple_push_v3" 7 | max_cycles: 100 8 | -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/simple_reference.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_simple_reference_config 3 | - _self_ 4 | 5 | 6 | task: "simple_reference_v3" 7 | max_cycles: 100 8 | local_ratio: 0.5 9 | -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/simple_speaker_listener.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_simple_speaker_listener_config 3 | - _self_ 4 | 5 | 6 | task: "simple_speaker_listener_v4" 7 | max_cycles: 100 8 | -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/simple_spread.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_simple_spread_config 3 | - _self_ 4 | 5 | 6 | task: "simple_spread_v3" 7 | max_cycles: 100 8 | N: 3 9 | local_ratio: 0.5 10 | -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/simple_tag.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_simple_tag_config 3 | - _self_ 4 | 5 | 6 | task: "simple_tag_v3" 7 | num_good: 2 8 | num_adversaries: 3 9 | num_obstacles: 2 10 | max_cycles: 100 11 | -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/simple_world_comm.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_simple_world_comm_config 3 | - _self_ 4 | 5 | 6 | task: "simple_world_comm_v3" 7 | num_good: 2 8 | num_adversaries: 4 9 | num_obstacles: 1 10 | num_food: 2 11 | num_forests: 2 12 | max_cycles: 100 13 | -------------------------------------------------------------------------------- /benchmarl/conf/task/pettingzoo/waterworld.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - pettingzoo_waterworld_config 3 | - _self_ 4 | 5 | 6 | task: "waterworld_v4" 7 | max_cycles: 500 8 | n_pursuers: 2 9 | n_evaders: 5 10 | n_poisons: 10 11 | n_obstacles: 1 12 | n_coop: 1 13 | n_sensors: 30 14 | sensor_range: 0.2 15 | radius: 0.015 16 | obstacle_radius: 0.1 17 | pursuer_max_accel: 0.5 18 | pursuer_speed: 0.2 19 | evader_speed: 0.1 20 | poison_speed: 0.1 21 | poison_reward: -1.0 22 | food_reward: 10.0 23 | encounter_reward: 0.01 24 | thrust_penalty: -0.5 25 | local_ratio: 1.0 26 | speed_features: True 27 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/protoss_10_vs_10.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_protoss" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | obs_own_pos: True 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 10 30 | n_enemies: 10 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "stalker" 35 | - "zealot" 36 | - "colossus" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | observe: True 42 | start_positions: 43 | dist_type: "surrounded_and_reflect" 44 | p: 0.5 45 | map_x: 32 46 | map_y: 32 47 | 48 | # enemy_mask: 49 | # dist_type: "mask" 50 | # mask_probability: 0.5 51 | # n_enemies: 5 52 | state_last_action: True 53 | state_timestep_number: False 54 | step_mul: 8 55 | heuristic_ai: False 56 | # heuristic_rest: False 57 | debug: False 58 | prob_obs_enemy: 1.0 59 | action_mask: True 60 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/protoss_10_vs_11.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_protoss" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | obs_own_pos: True 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 10 30 | n_enemies: 11 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "stalker" 35 | - "zealot" 36 | - "colossus" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | observe: True 42 | start_positions: 43 | dist_type: "surrounded_and_reflect" 44 | p: 0.5 45 | map_x: 32 46 | map_y: 32 47 | 48 | # enemy_mask: 49 | # dist_type: "mask" 50 | # mask_probability: 0.5 51 | # n_enemies: 5 52 | state_last_action: True 53 | state_timestep_number: False 54 | step_mul: 8 55 | heuristic_ai: False 56 | # heuristic_rest: False 57 | debug: False 58 | prob_obs_enemy: 1.0 59 | action_mask: True 60 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/protoss_20_vs_20.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_protoss" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | obs_own_pos: True 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 20 30 | n_enemies: 20 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "stalker" 35 | - "zealot" 36 | - "colossus" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | observe: True 42 | start_positions: 43 | dist_type: "surrounded_and_reflect" 44 | p: 0.5 45 | map_x: 32 46 | map_y: 32 47 | 48 | # enemy_mask: 49 | # dist_type: "mask" 50 | # mask_probability: 0.5 51 | # n_enemies: 5 52 | state_last_action: True 53 | state_timestep_number: False 54 | step_mul: 8 55 | heuristic_ai: False 56 | # heuristic_rest: False 57 | debug: False 58 | prob_obs_enemy: 1.0 59 | action_mask: True 60 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/protoss_20_vs_23.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_protoss" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | obs_own_pos: True 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 20 30 | n_enemies: 23 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "stalker" 35 | - "zealot" 36 | - "colossus" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | observe: True 42 | start_positions: 43 | dist_type: "surrounded_and_reflect" 44 | p: 0.5 45 | map_x: 32 46 | map_y: 32 47 | 48 | # enemy_mask: 49 | # dist_type: "mask" 50 | # mask_probability: 0.5 51 | # n_enemies: 5 52 | state_last_action: True 53 | state_timestep_number: False 54 | step_mul: 8 55 | heuristic_ai: False 56 | # heuristic_rest: False 57 | debug: False 58 | prob_obs_enemy: 1.0 59 | action_mask: True 60 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/protoss_5_vs_5.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_protoss" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | obs_own_pos: True 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 5 30 | n_enemies: 5 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "stalker" 35 | - "zealot" 36 | - "colossus" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | observe: True 42 | start_positions: 43 | dist_type: "surrounded_and_reflect" 44 | p: 0.5 45 | map_x: 32 46 | map_y: 32 47 | 48 | # enemy_mask: 49 | # dist_type: "mask" 50 | # mask_probability: 0.5 51 | # n_enemies: 5 52 | state_last_action: True 53 | state_timestep_number: False 54 | step_mul: 8 55 | heuristic_ai: False 56 | # heuristic_rest: False 57 | debug: False 58 | prob_obs_enemy: 1.0 59 | action_mask: True 60 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/terran_10_vs_10.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_terran" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | obs_own_pos: True 25 | use_unit_ranges: True 26 | min_attack_range: 2 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 10 30 | n_enemies: 10 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "marine" 35 | - "marauder" 36 | - "medivac" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | exception_unit_types: 42 | - "medivac" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/terran_10_vs_11.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_terran" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | obs_own_pos: True 25 | use_unit_ranges: True 26 | min_attack_range: 2 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 10 30 | n_enemies: 11 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "marine" 35 | - "marauder" 36 | - "medivac" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | exception_unit_types: 42 | - "medivac" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/terran_20_vs_20.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_terran" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | obs_own_pos: True 25 | use_unit_ranges: True 26 | min_attack_range: 2 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 20 30 | n_enemies: 20 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "marine" 35 | - "marauder" 36 | - "medivac" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | exception_unit_types: 42 | - "medivac" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/terran_20_vs_23.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_terran" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | obs_own_pos: True 25 | use_unit_ranges: True 26 | min_attack_range: 2 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 20 30 | n_enemies: 23 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "marine" 35 | - "marauder" 36 | - "medivac" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | exception_unit_types: 42 | - "medivac" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/terran_5_vs_5.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_terran" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | obs_own_pos: True 25 | use_unit_ranges: True 26 | min_attack_range: 2 27 | num_fov_actions: 12 28 | capability_config: 29 | n_units: 5 30 | n_enemies: 5 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "marine" 35 | - "marauder" 36 | - "medivac" 37 | weights: 38 | - 0.45 39 | - 0.45 40 | - 0.1 41 | exception_unit_types: 42 | - "medivac" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/zerg_10_vs_10.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_zerg" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | num_fov_actions: 12 27 | obs_own_pos: True 28 | capability_config: 29 | n_units: 10 30 | n_enemies: 10 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "zergling" 35 | - "baneling" 36 | - "hydralisk" 37 | weights: 38 | - 0.45 39 | - 0.1 40 | - 0.45 41 | exception_unit_types: 42 | - "baneling" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/zerg_10_vs_11.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_zerg" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | num_fov_actions: 12 27 | obs_own_pos: True 28 | capability_config: 29 | n_units: 10 30 | n_enemies: 11 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "zergling" 35 | - "baneling" 36 | - "hydralisk" 37 | weights: 38 | - 0.45 39 | - 0.1 40 | - 0.45 41 | exception_unit_types: 42 | - "baneling" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/zerg_20_vs_20.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_zerg" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | num_fov_actions: 12 27 | obs_own_pos: True 28 | capability_config: 29 | n_units: 20 30 | n_enemies: 20 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "zergling" 35 | - "baneling" 36 | - "hydralisk" 37 | weights: 38 | - 0.45 39 | - 0.1 40 | - 0.45 41 | exception_unit_types: 42 | - "baneling" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/zerg_20_vs_23.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_zerg" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | num_fov_actions: 12 27 | obs_own_pos: True 28 | capability_config: 29 | n_units: 20 30 | n_enemies: 23 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "zergling" 35 | - "baneling" 36 | - "hydralisk" 37 | weights: 38 | - 0.45 39 | - 0.1 40 | - 0.45 41 | exception_unit_types: 42 | - "baneling" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/smacv2/zerg_5_vs_5.yaml: -------------------------------------------------------------------------------- 1 | continuing_episode: False 2 | difficulty: "7" 3 | game_version: null 4 | map_name: "10gen_zerg" 5 | move_amount: 2 6 | obs_all_health: True 7 | obs_instead_of_state: False 8 | obs_last_action: False 9 | obs_own_health: True 10 | obs_pathing_grid: False 11 | obs_terrain_height: False 12 | obs_timestep_number: False 13 | reward_death_value: 10 14 | reward_defeat: 0 15 | reward_negative_scale: 0.5 16 | reward_only_positive: True 17 | reward_scale: True 18 | reward_scale_rate: 20 19 | reward_sparse: False 20 | reward_win: 200 21 | replay_dir: "" 22 | replay_prefix: "" 23 | conic_fov: False 24 | use_unit_ranges: True 25 | min_attack_range: 2 26 | num_fov_actions: 12 27 | obs_own_pos: True 28 | capability_config: 29 | n_units: 5 30 | n_enemies: 5 31 | team_gen: 32 | dist_type: "weighted_teams" 33 | unit_types: 34 | - "zergling" 35 | - "baneling" 36 | - "hydralisk" 37 | weights: 38 | - 0.45 39 | - 0.1 40 | - 0.45 41 | exception_unit_types: 42 | - "baneling" 43 | observe: True 44 | 45 | start_positions: 46 | dist_type: "surrounded_and_reflect" 47 | p: 0.5 48 | map_x: 32 49 | map_y: 32 50 | # enemy_mask: 51 | # dist_type: "mask" 52 | # mask_probability: 0.5 53 | # n_enemies: 5 54 | state_last_action: True 55 | state_timestep_number: False 56 | step_mul: 8 57 | heuristic_ai: False 58 | # heuristic_rest: False 59 | debug: False 60 | prob_obs_enemy: 1.0 61 | action_mask: True 62 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/balance.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_balance_config 3 | - _self_ 4 | 5 | max_steps: 100 6 | n_agents: 4 7 | random_package_pos_on_line: True 8 | package_mass: 5 9 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/ball_passage.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_ball_passage_config 3 | - _self_ 4 | 5 | max_steps: 500 6 | n_passages: 1 7 | fixed_passage: False 8 | random_start_angle: True 9 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/ball_trajectory.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_ball_trajectory_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | joints: True 8 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/buzz_wire.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_buzz_wire_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | random_start_angle: True 8 | collision_reward: -10 9 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/discovery.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_discovery_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | n_agents: 5 8 | n_targets: 7 9 | lidar_range: 0.35 10 | covering_range: 0.25 11 | agents_per_target: 2 12 | targets_respawn: True 13 | shared_reward: True 14 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/dispersion.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_dispersion_config 3 | - _self_ 4 | 5 | 6 | 7 | max_steps: 100 8 | n_agents: 4 9 | n_food: 4 10 | share_reward: True 11 | food_radius: 0.02 12 | penalise_by_time: False 13 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/dropout.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_dropout_config 3 | - _self_ 4 | 5 | 6 | 7 | max_steps: 100 8 | n_agents: 4 9 | energy_coeff: 0.02 10 | start_same_point: False 11 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/flocking.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_flocking_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | n_agents: 4 8 | n_obstacles: 5 9 | collision_reward: -0.1 10 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/football.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_football_config 3 | - _self_ 4 | 5 | 6 | max_steps: 500 7 | 8 | # Agents config 9 | n_blue_agents: 3 10 | n_red_agents: 3 11 | ai_red_agents: True # What agents should be learning and what controlled by the heuristic (ai) 12 | 13 | # When you have 5 blue agents, physical differences can be introduced: 14 | # 1 goalkeeper -> slow and big 15 | # 2 defenders -> normal size and speed (agent_size, u_multiplier, max_speed) 16 | # 2 attackers -> small and fast 17 | physically_different: False 18 | 19 | # Agent spawning 20 | spawn_in_formation: False 21 | only_blue_formation: True # Only spawn blue agents in formation 22 | formation_agents_per_column: 2 23 | randomise_formation_indices: False # If False, each agent will always be in the same formation spot 24 | formation_noise: 0.2 # Noise on formation positions 25 | 26 | # Ai config 27 | n_traj_points: 0 # Number of spline trajectory points to plot for heuristic (ai) agents 28 | ai_strength: 1.0 # The speed of the ai 0<=x<=1 29 | ai_decision_strength: 1.0 # The decision strength of the ai 0<=x<=1 30 | ai_precision_strength: 1.0 # The precision strength of the ai 0<=x<=1 31 | 32 | # Task sizes 33 | agent_size: 0.025 34 | goal_size: 0.35 35 | goal_depth: 0.1 36 | pitch_length: 3.0 37 | pitch_width: 1.5 38 | ball_mass: 0.25 39 | ball_size: 0.02 40 | 41 | # Actions 42 | u_multiplier: 0.1 43 | 44 | # Actions shooting 45 | enable_shooting: False # Whether to enable an extra 2 actions (for rotation and shooting). Only available for non-ai agents 46 | u_rot_multiplier: 0.0003 47 | u_shoot_multiplier: 0.6 48 | shooting_radius: 0.08 49 | shooting_angle: 1.5708 50 | 51 | # Speeds 52 | max_speed: 0.15 53 | ball_max_speed: 0.3 54 | 55 | # Rewards 56 | dense_reward: True 57 | pos_shaping_factor_ball_goal: 10.0 # Reward for moving the ball towards the opponents' goal. This can be annealed in a curriculum. 58 | pos_shaping_factor_agent_ball: 0.1 # Reward for moving the closest agent to the ball in a team closer to it. 59 | # This reward does not trigger if the agent is less than distance_to_ball_trigger from the ball or the ball is moving 60 | distance_to_ball_trigger: 0.4 61 | scoring_reward: 100.0 # Discrete reward for scoring 62 | 63 | # Observations 64 | observe_teammates: True 65 | observe_adversaries: True 66 | dict_obs: False 67 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/give_way.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_give_way_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | mirror_passage: False 8 | observe_rel_pos: False 9 | done_on_completion: False 10 | final_reward: 0.01 11 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/joint_passage.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_joint_passage_config 3 | - _self_ 4 | 5 | 6 | max_steps: 500 7 | n_passages: 1 8 | fixed_passage: True 9 | joint_length: 0.5 10 | random_start_angle: True 11 | random_goal_angle: True 12 | observe_joint_angle: False 13 | asym_package: True 14 | mass_ratio: 5 15 | mass_position: 0.75 16 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/joint_passage_size.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_joint_passage_size_config 3 | - _self_ 4 | 5 | 6 | max_steps: 500 7 | n_passages: 3 8 | fixed_passage: False 9 | random_start_angle: False 10 | random_goal_angle: False 11 | observe_joint_angle: False 12 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/multi_give_way.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_multi_give_way_config 3 | - _self_ 4 | 5 | 6 | max_steps: 200 7 | agent_collision_penalty: -0.1 8 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/navigation.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_navigation_config 3 | - _self_ 4 | 5 | 6 | 7 | max_steps: 100 8 | n_agents: 3 9 | collisions: True 10 | agents_with_same_goal: 1 11 | split_goals: False 12 | observe_all_goals: False 13 | shared_rew: False 14 | lidar_range: 0.35 15 | agent_radius: 0.1 16 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/passage.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_passage_config 3 | - _self_ 4 | 5 | 6 | max_steps: 500 7 | n_passages: 1 8 | shared_reward: True 9 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/reverse_transport.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_reverse_transport_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | n_agents: 4 8 | package_width: 0.6 9 | package_length: 0.6 10 | package_mass: 50 11 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/sampling.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_sampling_config 3 | - _self_ 4 | 5 | 6 | 7 | max_steps: 100 8 | n_agents: 3 9 | shared_rew: False 10 | n_gaussians: 3 11 | lidar_range: 0.2 12 | cov: 0.05 13 | collisions: True 14 | spawn_same_pos: False 15 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/simple_adversary.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_simple_adversary_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | n_agents: 3 8 | n_adversaries: 1 9 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/simple_crypto.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_simple_crypto_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | dim_c: 4 8 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/simple_push.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_simple_push_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/simple_reference.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_simple_reference_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/simple_speaker_listener.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_simple_speaker_listener_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/simple_spread.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_simple_spread_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | n_agents: 3 8 | obs_agents: True 9 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/simple_tag.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_simple_tag_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | num_good_agents: 1 8 | num_adversaries: 3 9 | num_landmarks: 2 10 | shape_agent_rew: False 11 | shape_adversary_rew: False 12 | agents_share_rew: False 13 | adversaries_share_rew: True 14 | observe_same_team: True 15 | observe_pos: True 16 | observe_vel: True 17 | bound: 1.0 18 | respawn_at_catch: False 19 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/simple_world_comm.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_simple_world_comm_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | num_good_agents: 2 8 | num_adversaries: 4 9 | num_landmarks: 1 10 | num_food: 2 11 | num_forests: 2 12 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/transport.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_transport_config 3 | - _self_ 4 | 5 | 6 | 7 | max_steps: 100 8 | n_agents: 4 9 | n_packages: 1 10 | package_width: 0.15 11 | package_length: 0.15 12 | package_mass: 50 13 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/wheel.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_wheel_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | n_agents: 4 8 | line_length: 1 9 | line_mass: 30 10 | desired_velocity: 0.05 11 | -------------------------------------------------------------------------------- /benchmarl/conf/task/vmas/wind_flocking.yaml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - vmas_wind_flocking_config 3 | - _self_ 4 | 5 | 6 | max_steps: 100 7 | horizon: 100 8 | dist_shaping_factor: 1 9 | vel_shaping_factor: 1 10 | wind_shaping_factor: 1 11 | rot_shaping_factor: 0 12 | pos_shaping_factor: 0 13 | energy_shaping_factor: 0 14 | wind: 0 15 | cover_angle_tolerance: 1 16 | observe_rel_pos: True 17 | observe_rel_vel: True 18 | observe_pos: False 19 | desired_vel: 0.4 20 | -------------------------------------------------------------------------------- /benchmarl/environments/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from .common import _get_task_config_class, Task, TaskClass 8 | 9 | from .magent.common import MAgentClass, MAgentTask 10 | from .meltingpot.common import MeltingPotClass, MeltingPotTask 11 | from .pettingzoo.common import PettingZooClass, PettingZooTask 12 | from .smacv2.common import Smacv2Class, Smacv2Task 13 | from .vmas.common import VmasClass, VmasTask 14 | 15 | # The enum classes for the environments available. 16 | # This is the only object in this file you need to modify when adding a new environment. 17 | tasks = [VmasTask, Smacv2Task, PettingZooTask, MeltingPotTask, MAgentTask] 18 | 19 | # This is a registry mapping "envname/task_name" to the EnvNameTask.TASK_NAME enum 20 | # It is used by automatically load task enums from yaml files. 21 | # It is populated automatically, do not modify. 22 | task_config_registry = {} 23 | 24 | # This is a registry mapping "envname_taskname" to the TaskConfig python dataclass of the task. 25 | # It is used by hydra to validate loaded configs. 26 | # You will see the "envname_taskname" strings in the hydra defaults at the top of yaml files. 27 | # This is optional and, if a task does not possess an associated TaskConfig, this entry will be simply skipped. 28 | # It is populated automatically, do not modify. 29 | _task_class_registry = {} 30 | 31 | # Automatic population of registries 32 | for env in tasks: 33 | env_config_registry = {} 34 | environemnt_name = env.env_name() 35 | for task in env: 36 | task_name = task.name.lower() 37 | full_task_name = f"{environemnt_name}/{task_name}" 38 | env_config_registry[full_task_name] = task 39 | 40 | task_config_class = _get_task_config_class(environemnt_name, task_name) 41 | if task_config_class is not None: 42 | _task_class_registry[full_task_name.replace("/", "_")] = task_config_class 43 | task_config_registry.update(env_config_registry) 44 | -------------------------------------------------------------------------------- /benchmarl/environments/magent/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/environments/magent/__init__.py -------------------------------------------------------------------------------- /benchmarl/environments/magent/adversarial_pursuit.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | map_size: int = MISSING 13 | minimap_mode: bool = MISSING 14 | tag_penalty: float = MISSING 15 | max_cycles: int = MISSING 16 | extra_features: bool = MISSING 17 | -------------------------------------------------------------------------------- /benchmarl/environments/meltingpot/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/BenchMARL/567acd93ee6a61d9cd8c0298a0ab19ab6728afa8/benchmarl/environments/meltingpot/__init__.py -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/multiwalker.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | n_walkers: int = MISSING 14 | shared_reward: bool = MISSING 15 | max_cycles: int = MISSING 16 | position_noise: float = MISSING 17 | angle_noise: float = MISSING 18 | forward_reward: float = MISSING 19 | fall_reward: float = MISSING 20 | terminate_reward: float = MISSING 21 | terminate_on_fall: bool = MISSING 22 | remove_on_fall: bool = MISSING 23 | terrain_length: int = MISSING 24 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/simple_adversary.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | N: int = MISSING 14 | max_cycles: int = MISSING 15 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/simple_crypto.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | max_cycles: int = MISSING 14 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/simple_push.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | max_cycles: int = MISSING 14 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/simple_reference.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | max_cycles: int = MISSING 14 | local_ratio: float = MISSING 15 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/simple_speaker_listener.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | max_cycles: int = MISSING 14 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/simple_spread.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | max_cycles: int = MISSING 14 | local_ratio: float = MISSING 15 | N: int = MISSING 16 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/simple_tag.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | num_good: int = MISSING 14 | num_adversaries: int = MISSING 15 | num_obstacles: int = MISSING 16 | max_cycles: int = MISSING 17 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/simple_world_comm.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | max_cycles: int = MISSING 14 | num_good: int = MISSING 15 | num_adversaries: int = MISSING 16 | num_obstacles: int = MISSING 17 | num_food: int = MISSING 18 | num_forests: int = MISSING 19 | -------------------------------------------------------------------------------- /benchmarl/environments/pettingzoo/waterworld.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | task: str = MISSING 13 | max_cycles: int = MISSING 14 | n_pursuers: int = MISSING 15 | n_evaders: int = MISSING 16 | n_poisons: int = MISSING 17 | n_obstacles: int = MISSING 18 | n_coop: int = MISSING 19 | n_sensors: int = MISSING 20 | sensor_range: float = MISSING 21 | radius: float = MISSING 22 | obstacle_radius: float = MISSING 23 | pursuer_max_accel: float = MISSING 24 | pursuer_speed: float = MISSING 25 | evader_speed: float = MISSING 26 | poison_speed: float = MISSING 27 | poison_reward: float = MISSING 28 | food_reward: float = MISSING 29 | encounter_reward: float = MISSING 30 | thrust_penalty: float = MISSING 31 | local_ratio: float = MISSING 32 | speed_features: bool = MISSING 33 | -------------------------------------------------------------------------------- /benchmarl/environments/smacv2/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/balance.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | random_package_pos_on_line: bool = MISSING 15 | package_mass: float = MISSING 16 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/ball_passage.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_passages: int = MISSING 14 | fixed_passage: bool = MISSING 15 | random_start_angle: bool = MISSING 16 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/ball_trajectory.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | joints: bool = MISSING 14 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/buzz_wire.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | random_start_angle: bool = MISSING 14 | collision_reward: float = MISSING 15 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/discovery.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | n_targets: int = MISSING 15 | lidar_range: float = MISSING 16 | covering_range: float = MISSING 17 | agents_per_target: int = MISSING 18 | targets_respawn: bool = MISSING 19 | shared_reward: bool = MISSING 20 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/dispersion.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | n_food: int = MISSING 15 | share_reward: bool = MISSING 16 | food_radius: float = MISSING 17 | penalise_by_time: bool = MISSING 18 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/dropout.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | energy_coeff: float = MISSING 15 | start_same_point: bool = MISSING 16 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/flocking.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | n_obstacles: int = MISSING 15 | collision_reward: float = MISSING 16 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/football.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | 14 | # Agents config 15 | n_blue_agents: int = MISSING 16 | n_red_agents: int = MISSING 17 | ai_red_agents: bool = MISSING 18 | physically_different: bool = MISSING 19 | 20 | # Agent spawning 21 | spawn_in_formation: bool = MISSING 22 | formation_agents_per_column: int = MISSING 23 | randomise_formation_indices: bool = MISSING 24 | only_blue_formation: bool = MISSING 25 | formation_noise: float = MISSING 26 | 27 | # Opponent heuristic config 28 | n_traj_points: int = MISSING 29 | ai_strength: float = MISSING 30 | ai_decision_strength: float = MISSING 31 | ai_precision_strength: float = MISSING 32 | 33 | # Task sizes 34 | agent_size: float = MISSING 35 | goal_size: float = MISSING 36 | goal_depth: float = MISSING 37 | pitch_length: float = MISSING 38 | pitch_width: float = MISSING 39 | ball_mass: float = MISSING 40 | ball_size: float = MISSING 41 | 42 | # Actions 43 | u_multiplier: float = MISSING 44 | 45 | # Actions shooting 46 | enable_shooting: bool = MISSING 47 | u_rot_multiplier: float = MISSING 48 | u_shoot_multiplier: float = MISSING 49 | shooting_radius: float = MISSING 50 | shooting_angle: float = MISSING 51 | 52 | # Speeds 53 | max_speed: float = MISSING 54 | ball_max_speed: float = MISSING 55 | 56 | # Rewards 57 | dense_reward: bool = MISSING 58 | pos_shaping_factor_ball_goal: float = MISSING 59 | pos_shaping_factor_agent_ball: float = MISSING 60 | distance_to_ball_trigger: float = MISSING 61 | scoring_reward: float = MISSING 62 | 63 | # Observations 64 | observe_teammates: bool = MISSING 65 | observe_adversaries: bool = MISSING 66 | dict_obs: bool = MISSING 67 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/give_way.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | mirror_passage: bool = MISSING 14 | observe_rel_pos: bool = MISSING 15 | done_on_completion: bool = MISSING 16 | final_reward: float = MISSING 17 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/joint_passage.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_passages: int = MISSING 14 | fixed_passage: bool = MISSING 15 | joint_length: float = MISSING 16 | random_start_angle: bool = MISSING 17 | random_goal_angle: bool = MISSING 18 | observe_joint_angle: bool = MISSING 19 | asym_package: bool = MISSING 20 | mass_ratio: float = MISSING 21 | mass_position: float = MISSING 22 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/joint_passage_size.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_passages: int = MISSING 14 | fixed_passage: bool = MISSING 15 | random_start_angle: bool = MISSING 16 | random_goal_angle: bool = MISSING 17 | observe_joint_angle: bool = MISSING 18 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/multi_give_way.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | agent_collision_penalty: float = MISSING 14 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/navigation.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | collisions: bool = MISSING 15 | agents_with_same_goal: int = MISSING 16 | observe_all_goals: bool = MISSING 17 | shared_rew: bool = MISSING 18 | split_goals: bool = MISSING 19 | lidar_range: float = MISSING 20 | agent_radius: float = MISSING 21 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/passage.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_passages: int = MISSING 14 | shared_reward: bool = MISSING 15 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/reverse_transport.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | package_width: float = MISSING 15 | package_length: float = MISSING 16 | package_mass: float = MISSING 17 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/sampling.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | shared_rew: bool = MISSING 15 | n_gaussians: int = MISSING 16 | lidar_range: float = MISSING 17 | cov: float = MISSING 18 | collisions: bool = MISSING 19 | spawn_same_pos: bool = MISSING 20 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/simple_adversary.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | n_adversaries: int = MISSING 15 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/simple_crypto.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | dim_c: int = MISSING 14 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/simple_push.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/simple_reference.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/simple_speaker_listener.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/simple_spread.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | obs_agents: bool = MISSING 14 | n_agents: int = MISSING 15 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/simple_tag.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | num_good_agents: int = MISSING 14 | num_adversaries: int = MISSING 15 | num_landmarks: int = MISSING 16 | shape_agent_rew: bool = MISSING 17 | shape_adversary_rew: bool = MISSING 18 | agents_share_rew: bool = MISSING 19 | adversaries_share_rew: bool = MISSING 20 | observe_same_team: bool = MISSING 21 | observe_pos: bool = MISSING 22 | observe_vel: bool = MISSING 23 | bound: float = MISSING 24 | respawn_at_catch: bool = MISSING 25 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/simple_world_comm.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | num_good_agents: int = MISSING 14 | num_adversaries: int = MISSING 15 | num_landmarks: int = MISSING 16 | num_food: int = MISSING 17 | num_forests: int = MISSING 18 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/transport.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | n_packages: int = MISSING 15 | package_width: float = MISSING 16 | package_length: float = MISSING 17 | package_mass: float = MISSING 18 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/wheel.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | n_agents: int = MISSING 14 | line_length: float = MISSING 15 | line_mass: float = MISSING 16 | desired_velocity: float = MISSING 17 | -------------------------------------------------------------------------------- /benchmarl/environments/vmas/wind_flocking.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from dataclasses import dataclass, MISSING 8 | 9 | 10 | @dataclass 11 | class TaskConfig: 12 | max_steps: int = MISSING 13 | dist_shaping_factor: float = MISSING 14 | rot_shaping_factor: float = MISSING 15 | vel_shaping_factor: float = MISSING 16 | pos_shaping_factor: float = MISSING 17 | energy_shaping_factor: float = MISSING 18 | wind_shaping_factor: float = MISSING 19 | wind: float = MISSING 20 | cover_angle_tolerance: float = MISSING 21 | horizon: int = MISSING 22 | observe_rel_pos: bool = MISSING 23 | observe_rel_vel: bool = MISSING 24 | observe_pos: bool = MISSING 25 | desired_vel: float = MISSING 26 | -------------------------------------------------------------------------------- /benchmarl/evaluate.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | import argparse 7 | from pathlib import Path 8 | 9 | from benchmarl.hydra_config import reload_experiment_from_file 10 | 11 | if __name__ == "__main__": 12 | parser = argparse.ArgumentParser( 13 | description="Evaluates the experiment from a checkpoint file." 14 | ) 15 | parser.add_argument( 16 | "checkpoint_file", type=str, help="The name of the checkpoint file" 17 | ) 18 | args = parser.parse_args() 19 | checkpoint_file = str(Path(args.checkpoint_file).resolve()) 20 | 21 | experiment = reload_experiment_from_file(checkpoint_file) 22 | 23 | experiment.evaluate() 24 | -------------------------------------------------------------------------------- /benchmarl/experiment/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from .callback import Callback 8 | from .experiment import Experiment, ExperimentConfig 9 | -------------------------------------------------------------------------------- /benchmarl/models/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | from .cnn import Cnn, CnnConfig 8 | from .common import ( 9 | EnsembleModelConfig, 10 | Model, 11 | ModelConfig, 12 | SequenceModel, 13 | SequenceModelConfig, 14 | ) 15 | from .deepsets import Deepsets, DeepsetsConfig 16 | from .gnn import Gnn, GnnConfig 17 | from .gru import Gru, GruConfig 18 | from .lstm import Lstm, LstmConfig 19 | from .mlp import Mlp, MlpConfig 20 | 21 | classes = [ 22 | "Mlp", 23 | "MlpConfig", 24 | "Gnn", 25 | "GnnConfig", 26 | "Cnn", 27 | "CnnConfig", 28 | "Deepsets", 29 | "DeepsetsConfig", 30 | "Gru", 31 | "GruConfig", 32 | "Lstm", 33 | "LstmConfig", 34 | ] 35 | 36 | model_config_registry = { 37 | "mlp": MlpConfig, 38 | "gnn": GnnConfig, 39 | "cnn": CnnConfig, 40 | "deepsets": DeepsetsConfig, 41 | "gru": GruConfig, 42 | "lstm": LstmConfig, 43 | } 44 | -------------------------------------------------------------------------------- /benchmarl/resume.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | import argparse 7 | from pathlib import Path 8 | 9 | from benchmarl.hydra_config import reload_experiment_from_file 10 | 11 | if __name__ == "__main__": 12 | parser = argparse.ArgumentParser( 13 | description="Resumes the experiment from a checkpoint file." 14 | ) 15 | parser.add_argument( 16 | "checkpoint_file", type=str, help="The name of the checkpoint file" 17 | ) 18 | args = parser.parse_args() 19 | checkpoint_file = str(Path(args.checkpoint_file).resolve()) 20 | 21 | experiment = reload_experiment_from_file(checkpoint_file) 22 | 23 | experiment.run() 24 | -------------------------------------------------------------------------------- /benchmarl/run.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | # 6 | 7 | import hydra 8 | from hydra.core.hydra_config import HydraConfig 9 | from omegaconf import DictConfig, OmegaConf 10 | 11 | from benchmarl.hydra_config import load_experiment_from_hydra 12 | 13 | 14 | @hydra.main(version_base=None, config_path="conf", config_name="config") 15 | def hydra_experiment(cfg: DictConfig) -> None: 16 | """Runs an experiment loading its config from hydra. 17 | 18 | This function is decorated as ``@hydra.main`` and is called by running 19 | 20 | .. code-block:: console 21 | 22 | python benchmarl/run.py algorithm=mappo task=vmas/balance 23 | 24 | 25 | Args: 26 | cfg (DictConfig): the hydra config dictionary 27 | 28 | """ 29 | hydra_choices = HydraConfig.get().runtime.choices 30 | task_name = hydra_choices.task 31 | algorithm_name = hydra_choices.algorithm 32 | 33 | print(f"\nAlgorithm: {algorithm_name}, Task: {task_name}") 34 | print("\nLoaded config:\n") 35 | print(OmegaConf.to_yaml(cfg)) 36 | 37 | experiment = load_experiment_from_hydra(cfg, task_name=task_name) 38 | experiment.run() 39 | 40 | 41 | if __name__ == "__main__": 42 | hydra_experiment() 43 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | git+https://github.com/matteobettini/benchmarl_sphinx_theme.git 2 | torchrl>=0.2.0 3 | torch 4 | tqdm 5 | hydra-core 6 | vmas>=1.2.10 7 | -------------------------------------------------------------------------------- /docs/source/_static/js/version_alert.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | * 7 | */ 8 | 9 | function warnOnLatestVersion() { 10 | if (!window.READTHEDOCS_DATA || window.READTHEDOCS_DATA.version !== "latest") { 11 | return; // not on ReadTheDocs and not latest. 12 | } 13 | 14 | var note = document.createElement('div'); 15 | note.setAttribute('class', 'admonition note'); 16 | note.innerHTML = "

Note

" + 17 | "

" + 18 | "This documentation is for an unreleased development version. " + 19 | "Click here to access the documentation of the current stable release." + 20 | "

"; 21 | 22 | var parent = document.querySelector('#benchmarl'); 23 | if (parent) 24 | parent.insertBefore(note, parent.querySelector('h1')); 25 | } 26 | 27 | document.addEventListener('DOMContentLoaded', warnOnLatestVersion); 28 | -------------------------------------------------------------------------------- /docs/source/_templates/autosummary/class.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline }} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. autoclass:: {{ objname }} 6 | :show-inheritance: 7 | :members: 8 | :undoc-members: 9 | :inherited-members: 10 | -------------------------------------------------------------------------------- /docs/source/_templates/autosummary/class_no_inherit.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline }} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. autoclass:: {{ objname }} 6 | :show-inheritance: 7 | :members: 8 | :undoc-members: 9 | -------------------------------------------------------------------------------- /docs/source/_templates/autosummary/class_no_undoc.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline }} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. autoclass:: {{ objname }} 6 | :show-inheritance: 7 | :members: 8 | :inherited-members: 9 | -------------------------------------------------------------------------------- /docs/source/_templates/autosummary/class_private.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline }} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. autoclass:: {{ objname }} 6 | :show-inheritance: 7 | :members: 8 | :undoc-members: 9 | :private-members: 10 | -------------------------------------------------------------------------------- /docs/source/_templates/autosummary/class_private_no_undoc.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline }} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. autoclass:: {{ objname }} 6 | :show-inheritance: 7 | :members: 8 | :private-members: 9 | -------------------------------------------------------------------------------- /docs/source/_templates/breadcrumbs.html: -------------------------------------------------------------------------------- 1 | {%- extends "sphinx_rtd_theme/breadcrumbs.html" %} 2 | 3 | {% block breadcrumbs_aside %} 4 | {% endblock %} 5 | -------------------------------------------------------------------------------- /docs/source/concepts/benchmarks.rst: -------------------------------------------------------------------------------- 1 | Public benchmarks 2 | ================= 3 | 4 | .. warning:: 5 | This section is under a work in progress. We are constantly working on fine-tuning 6 | our experiments to enable our users to have access to state-of-the-art benchmarks. 7 | If you would like to collaborate in this effort, please reach out to us. 8 | 9 | In the `fine_tuned `__ 10 | folder we are collecting some tested hyperparameters for 11 | specific environments to enable users to bootstrap their benchmarking. 12 | You can just run the scripts in this folder to automatically use the proposed hyperparameters. 13 | 14 | We will tune benchmarks for you and publish the config and benchmarking plots on 15 | :wandb:`null` `Wandb `__ publicly. 16 | 17 | Currently available ones are: 18 | 19 | VMAS 20 | ---- 21 | `Conf `__ | :wandb:`null` `Wandb `__ 22 | 23 | .. raw:: html 24 | 25 |