{"id":13492957,"url":"https://github.com/microsoft/maro","last_synced_at":"2025-05-14T05:10:25.050Z","repository":{"id":36972033,"uuid":"230389247","full_name":"microsoft/maro","owner":"microsoft","description":"Multi-Agent Resource Optimization (MARO) platform is an instance of Reinforcement Learning as a Service (RaaS) for real-world resource optimization problems. ","archived":false,"fork":false,"pushed_at":"2025-04-24T17:10:03.000Z","size":115083,"stargazers_count":881,"open_issues_count":23,"forks_count":156,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-05-07T23:47:04.892Z","etag":null,"topics":["agent","citi-bike","docker","finance","inventory-management","logistics","maro","multi-agent","multi-agent-reinforcement-learning","operations-research","raas","reinforcement-learning","resource-optimization","rl-algorithms","simulator","transportation"],"latest_commit_sha":null,"homepage":"https://maro.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-27T06:48:27.000Z","updated_at":"2025-05-05T18:37:56.000Z","dependencies_parsed_at":"2023-02-16T05:00:27.546Z","dependency_job_id":"4f03fdc4-e401-4b82-a614-79fd4cfe450c","html_url":"https://github.com/microsoft/maro","commit_stats":{"total_commits":490,"total_committers":34,"mean_commits":"14.411764705882353","dds":0.7408163265306122,"last_synced_commit":"34c2dc9cae70e18eab7d64b54ed46d78625e3301"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmaro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmaro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmaro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmaro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/maro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076849,"owners_count":22010611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","citi-bike","docker","finance","inventory-management","logistics","maro","multi-agent","multi-agent-reinforcement-learning","operations-research","raas","reinforcement-learning","resource-optimization","rl-algorithms","simulator","transportation"],"created_at":"2024-07-31T19:01:10.829Z","updated_at":"2025-05-14T05:10:25.032Z","avatar_url":"https://github.com/microsoft.png","language":"Python","readme":"[![License](https://img.shields.io/pypi/l/pymaro)](https://github.com/microsoft/maro/blob/master/LICENSE)\n[![Platform](https://raw.githubusercontent.com/microsoft/maro/master/docs/source/images/badges/platform.svg)](https://pypi.org/project/pymaro/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pymaro.svg?logo=python\u0026logoColor=white)](https://pypi.org/project/pymaro/#files)\n[![Code Size](https://img.shields.io/github/languages/code-size/microsoft/maro)](https://github.com/microsoft/maro)\n[![Docker Size](https://img.shields.io/docker/image-size/maro2020/maro)](https://hub.docker.com/repository/docker/maro2020/maro/tags?page=1)\n[![Issues](https://img.shields.io/github/issues/microsoft/maro)](https://github.com/microsoft/maro/issues)\n[![Pull Requests](https://img.shields.io/github/issues-pr/microsoft/maro)](https://github.com/microsoft/maro/pulls)\n[![Dependencies](https://img.shields.io/librariesio/github/microsoft/maro)](https://libraries.io/pypi/pymaro)\n[![test](https://github.com/microsoft/maro/workflows/test/badge.svg)](https://github.com/microsoft/maro/actions?query=workflow%3Atest)\n[![build](https://github.com/microsoft/maro/workflows/build/badge.svg)](https://github.com/microsoft/maro/actions?query=workflow%3Abuild)\n[![docker](https://github.com/microsoft/maro/workflows/docker/badge.svg)](https://hub.docker.com/repository/docker/maro2020/maro)\n[![docs](https://readthedocs.org/projects/maro/badge/?version=latest)](https://maro.readthedocs.io/)\n[![PypI Versions](https://img.shields.io/pypi/v/pymaro)](https://pypi.org/project/pymaro/#files)\n[![Wheel](https://img.shields.io/pypi/wheel/pymaro)](https://pypi.org/project/pymaro/#files)\n[![Citi Bike](https://raw.githubusercontent.com/microsoft/maro/master/docs/source/images/badges/citi_bike.svg)](https://maro.readthedocs.io/en/latest/scenarios/citi_bike.html)\n[![CIM](https://raw.githubusercontent.com/microsoft/maro/master/docs/source/images/badges/cim.svg)](https://maro.readthedocs.io/en/latest/scenarios/container_inventory_management.html)\n[![VM Scheduling](https://raw.githubusercontent.com/microsoft/maro/master/docs/source/images/badges/vm_scheduling.svg)](https://maro.readthedocs.io/en/latest/scenarios/vm_scheduling.html)\n[![Gitter](https://img.shields.io/gitter/room/microsoft/maro)](https://gitter.im/Microsoft/MARO#)\n[![Stack Overflow](https://raw.githubusercontent.com/microsoft/maro/master/docs/source/images/badges/stack_overflow.svg)](https://stackoverflow.com/questions/ask?tags=maro)\n[![Releases](https://img.shields.io/github/release-date-pre/microsoft/maro)](https://github.com/microsoft/maro/releases)\n[![Commits](https://img.shields.io/github/commits-since/microsoft/maro/latest/master)](https://github.com/microsoft/maro/commits/master)\n[![Vulnerability Scan](https://github.com/microsoft/maro/workflows/vulnerability%20scan/badge.svg)](https://github.com/microsoft/maro/actions?query=workflow%3A%22vulnerability+scan%22)\n[![Lint](https://github.com/microsoft/maro/workflows/lint/badge.svg)](https://github.com/microsoft/maro/actions?query=workflow%3Alint)\n[![Coverage](https://img.shields.io/codecov/c/github/microsoft/maro)](https://codecov.io/gh/microsoft/maro)\n[![Downloads](https://img.shields.io/pypi/dm/pymaro)](https://pypi.org/project/pymaro/#files)\n[![Docker Pulls](https://img.shields.io/docker/pulls/maro2020/maro)](https://hub.docker.com/repository/docker/maro2020/maro)\n[![Play with MARO](https://raw.githubusercontent.com/microsoft/maro/master/docs/source/images/badges/play_with_maro.svg)](https://hub.docker.com/r/maro2020/maro)\n\n# [![MARO LOGO](./docs/source/images/logo.svg)](https://maro.readthedocs.io/en/latest/)\n\nMulti-Agent Resource Optimization (MARO) platform is an instance of Reinforcement\nlearning as a Service (RaaS) for real-world resource optimization. It can be\napplied to many important industrial domains, such as [container inventory\nmanagement](https://maro.readthedocs.io/en/latest/scenarios/container_inventory_management.html)\nin logistics, [bike repositioning](https://maro.readthedocs.io/en/latest/scenarios/citi_bike.html)\nin transportation, [virtual machine](https://maro.readthedocs.io/en/latest/scenarios/vm_scheduling.html) provisioning in data centers, and asset management in finance. Besides\n[Reinforcement Learning](https://www.andrew.cmu.edu/course/10-703/textbook/BartoSutton.pdf) (RL),\nit also supports other planning/decision mechanisms, such as\n[Operations Research](https://en.wikipedia.org/wiki/Operations_research).\n\nKey Components of MARO:\n\n- Simulation toolkit: it provides some predefined scenarios, and the reusable\nwheels for building new scenarios.\n- RL toolkit: it provides a full-stack abstraction for RL, such as agent manager,\nagent, RL algorithms, learner, actor, and various shapers.\n- Distributed toolkit: it provides distributed communication components, interface\nof user-defined functions for message auto-handling, cluster provision, and job orchestration.\n\n![MARO Key Components](./docs/source/images/maro_overview.svg)\n\n## Contents\n\n| File/folder | Description                                                                                       |\n| ----------- | ------------------------------------------------------------------------------------------------- |\n| `maro`      | MARO source code.                                                                                 |\n| `docs`      | MARO docs, it is host on [readthedocs](https://maro.readthedocs.io/en/latest/).                   |\n| `examples`  | Showcase of MARO.                                                                                 |\n| `notebooks` | MARO quick-start notebooks.                                                                       |\n\n*Try [MARO playground](#run-playground) to have a quick experience.*\n\n## Install MARO from [PyPI](https://pypi.org/project/pymaro/#files)\n\n*Notes: The CLI commands (including the visualization tool) are not included in pymaro package. To enable these support, you need to install from source.*\n\n- Mac OS / Linux\n\n  ```sh\n  pip install pymaro\n  ```\n\n- Windows\n\n  ```powershell\n  # Install torch first, if you don't have one.\n  pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html\n\n  pip install pymaro\n  ```\n\n## Install MARO from Source\n\n*Notes: Install from source if you want to use the CLI commands (including the visualization tool).*\n\n- Prerequisites\n  - C++ Compiler\n    - Linux or Mac OS X: `gcc`\n    - Windows: [Build Tools for Visual Studio 2017](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools\u0026rel=15)\n\n- Enable Virtual Environment\n  - Mac OS / Linux\n\n    ```sh\n    # If your environment is not clean, create a virtual environment firstly.\n    python -m venv maro_venv\n    source ./maro_venv/bin/activate\n    ```\n\n  - Windows\n\n    ```powershell\n    # If your environment is not clean, create a virtual environment firstly.\n    python -m venv maro_venv\n\n    # You may need this for SecurityError in PowerShell.\n    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted\n\n    # Activate the virtual environment.\n    .\\maro_venv\\Scripts\\activate\n    ```\n\n- Install MARO\n\n  ```sh\n  # Git Clone the whole source code.\n  git clone https://github.com/microsoft/maro.git\n  ```\n\n  - Mac OS / Linux\n\n    ```sh\n    # Install MARO from source.\n    bash scripts/install_maro.sh;\n    pip install -r ./requirements.dev.txt;\n    ```\n\n  - Windows\n\n    ```powershell\n    # Install MARO from source.\n    .\\scripts\\install_maro.bat;\n    pip install -r ./requirements.dev.txt;\n    ```\n\n- *Notes: If your package is not found, remember to set your PYTHONPATH*\n\n  - Mac OS / Linux\n\n  ```sh\n  export PYTHONPATH=PATH-TO-MARO\n  ```\n\n  - Windows\n\n  ```powershell\n  $Env:PYTHONPATH=PATH-TO-MARO\n  ```\n\n## Quick Example\n\n```python\nfrom maro.simulator import Env\n\nenv = Env(scenario=\"cim\", topology=\"toy.5p_ssddd_l0.0\", start_tick=0, durations=100)\n\nmetrics, decision_event, is_done = env.step(None)\n\nwhile not is_done:\n    metrics, decision_event, is_done = env.step(None)\n\nprint(f\"environment metrics: {env.metrics}\")\n\n```\n\n## [Environment Visualization](https://maro.readthedocs.io/en/latest/)\n\n```sh\n# Enable environment dump feature, when initializing the environment instance\nenv = Env(scenario=\"cim\",\n          topology=\"toy.5p_ssddd_l0.0\",\n          start_tick=0,\n          durations=100,\n          options={\"enable-dump-snapshot\": \"./dump_data\"})\n\n# Inspect environment with the dump data\nmaro inspector dashboard --source_path ./dump_data/YOUR_SNAPSHOT_DUMP_FOLDER\n```\n\n### Show Cases\n\n- Case I - Container Inventory Management\n![CIM Inter Epoch](./docs/source/images/visualization/dashboard/cim_inter_epoch.gif)\n![CIM Intra Epoch](./docs/source/images/visualization/dashboard/cim_intra_epoch_by_ports.gif)\n\n- Case II - Citi Bike\n![Citi Bike Inter Epoch](./docs/source/images/visualization/dashboard/citi_bike_inter_epoch.gif)\n![Citi Bike Intra Epoch](./docs/source/images/visualization/dashboard/citi_bike_intra_epoch_by_station.gif)\n\n## Run Playground\n\n- Pull from [Docker Hub](https://hub.docker.com/r/maro2020/playground)\n\n  ```sh\n  # Pull the docker image from docker hub\n  docker pull maro2020/playground\n\n  # Run playground container.\n  # Redis commander (GUI for redis) -\u003e http://127.0.0.1:40009\n  # Jupyter lab with maro -\u003e http://127.0.0.1:40010\n  docker run -p 40009:40009 -p 40010:40010 maro2020/playground\n  ```\n\n- Build from source\n  - Mac OS / Linux\n\n    ```sh\n    # Build playground image.\n    bash ./scripts/build_playground.sh\n\n    # Run playground container.\n    # Redis commander (GUI for redis) -\u003e http://127.0.0.1:40009\n    # Jupyter lab with maro -\u003e http://127.0.0.1:40010\n    docker run -p 40009:40009 -p 40010:40010 maro2020/playground\n    ```\n\n  - Windows\n\n    ```powershell\n    # Build playground image.\n    .\\scripts\\build_playground.bat\n\n    # Run playground container.\n    # Redis commander (GUI for redis) -\u003e http://127.0.0.1:40009\n    # Jupyter lab with maro -\u003e http://127.0.0.1:40010\n    docker run -p 40009:40009 -p 40010:40010 maro2020/playground\n    ```\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require\nyou to agree to a Contributor License Agreement (CLA) declaring that you have\nthe right to, and actually do, grant us the rights to use your contribution. For\ndetails, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether\nyou need to provide a CLA and decorate the PR appropriately (e.g., status check,\ncomment). Simply follow the instructions provided by the bot. You will only need\nto do this once across all repos using our CLA.\n\nThis project has adopted the\n[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the\n[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)\nor contact [opencode@microsoft.com](mailto:opencode@microsoft.com)\nwith any additional questions or comments.\n\n## Related Papers\n\n### [Container Inventory Management](https://maro.readthedocs.io/en/latest/scenarios/container_inventory_management.html)\n\n![CIM Vis](./docs/source/images/scenario/cim_vis.gif)\n\nWenlei Shi, Xinran Wei, Jia Zhang, Xiaoyuan Ni, Arthur Jiang, Jiang Bian, Tie-Yan Liu. \"[Cooperative Policy Learning with Pre-trained Heterogeneous Observation Representations](https://arxiv.org/abs/2012.13099)\". AAMAS 2021\n\nXihan Li, Jia Zhang, Jiang Bian, Yunhai Tong, Tie-Yan Liu. \"[A Cooperative Multi-Agent Reinforcement Learning Framework for Resource Balancing in Complex Logistics Network](https://arxiv.org/abs/1903.00714)\". AAMAS 2019\n\n## Related News\n\n[MSRA Top-10 Hack-Techs in 2021](https://mp.weixin.qq.com/s/Y4kjQq8gKcsEsVadjdwnEQ)\n\n[Open Source Platform MARO: Anywhere Door for Resource Optimization](https://mp.weixin.qq.com/s/zXIpgzomLhDWS_YUFmRlEQ)\n\n[AI from \"Point\" to \"Surface\"](https://mp.weixin.qq.com/s/PggO49wwmS7grTO0nEMgVQ)\n\n## [Cite Us](./CITATION)\n\n## License\n\nCopyright (c) Microsoft Corporation. All rights reserved.\n\nLicensed under the [MIT](./LICENSE) License.\n","funding_links":[],"categories":["Uncategorized","Table of Contents"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fmaro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fmaro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fmaro/lists"}