Package: pymaro
Multi-Agent Resource Optimization (MARO) platform is an instance of Reinforcement
learning as a Service (RaaS) for real-world resource optimization. It can be
applied to many important industrial domains, such ascontainer inventory
managementin logistics,bike repositioningin transportation,virtual machineprovisioning in data centers, and asset management in finance. BesidesReinforcement Learning(RL),
it also supports other planning/decision mechanisms, such asOperations Research.Key Components of MARO:Simulation toolkit: it provides some predefined scenarios, and the reusable
wheels for building new scenarios.RL toolkit: it provides a full-stack abstraction for RL, such as agent manager,
agent, RL algorithms, learner, actor, and various shapers.Distributed toolkit: it provides distributed communication components, interface
of user-defined functions for message auto-handling, cluster provision, and job orchestration.ContentsFile/folderDescriptionmaroMARO source code.docsMARO docs, it is host onreadthedocs.examplesShowcase of MARO.notebooksMARO quick-start notebooks.Try `MARO playground <#run-playground>`_ to have a quick experience.Install MARO fromPyPINotes: The CLI commands (including the visualization tool) are not included in pymaro package. To enable these support, you need to install from source.Mac OS / LinuxpipinstallpymaroWindows# Install torch first, if you don't have one.pipinstalltorch===1.6.0torchvision===0.7.0-fhttps://download.pytorch.org/whl/torch_stable.htmlpipinstallpymaroInstall MARO from SourceNotes: Install from source if you want to use the CLI commands (including the visualization tool).PrerequisitesC++ CompilerLinux or Mac OS X:gccWindows:Build Tools for Visual Studio 2017Enable Virtual EnvironmentMac OS / Linux# If your environment is not clean, create a virtual environment firstly.python-mvenvmaro_venvsource./maro_venv/bin/activateWindows# If your environment is not clean, create a virtual environment firstly.python-mvenvmaro_venv# You may need this for SecurityError in PowerShell.Set-ExecutionPolicy-ScopeCurrentUser-ExecutionPolicyUnrestricted# Activate the virtual environment..\maro_venv\Scripts\activateInstall MARO# Git Clone the whole source code.gitclonehttps://github.com/microsoft/maro.gitMac OS / Linux# Install MARO from source.bashscripts/install_maro.shWindows# Install MARO from source..\scripts\install_maro.batNotes: If your package is not found, remember to set your PYTHONPATHMac OS / LinuxexportPYTHONPATH=PATH-TO-MAROWindows$Env:PYTHONPATH=PATH-TO-MAROQuick Examplefrommaro.simulatorimportEnvenv=Env(scenario="cim",topology="toy.5p_ssddd_l0.0",start_tick=0,durations=100)metrics,decision_event,is_done=env.step(None)whilenotis_done:metrics,decision_event,is_done=env.step(None)print(f"environment metrics:{env.metrics}")Environment Visualization# Enable environment dump feature, when initializing the environment instanceenv=Env(scenario="cim",topology="toy.5p_ssddd_l0.0",start_tick=0,durations=100,options={"enable-dump-snapshot":"./dump_data"})# Inspect environment with the dump datamaroinspectordashboard--source_path./dump_data/YOUR_SNAPSHOT_DUMP_FOLDERShow CasesCase I - Container Inventory ManagementCase II - Citi BikeRun PlaygroundPull fromDocker Hub# Pull the docker image from docker hubdockerpullmaro2020/playground# Run playground container.
# Redis commander (GUI for redis) -> http://127.0.0.1:40009
# Jupyter lab with maro -> http://127.0.0.1:40010dockerrun-p40009:40009-p40010:40010maro2020/playgroundBuild from sourceMac OS / Linux# Build playground image.bash./scripts/build_playground.sh# Run playground container.# Redis commander (GUI for redis) -> http://127.0.0.1:40009# Jupyter lab with maro -> http://127.0.0.1:40010dockerrun-p40009:40009-p40010:40010maro2020/playgroundWindows# Build playground image..\scripts\build_playground.bat# Run playground container.# Redis commander (GUI for redis) -> http://127.0.0.1:40009# Jupyter lab with maro -> http://127.0.0.1:40010dockerrun-p40009:40009-p40010:40010maro2020/playgroundContributingThis project welcomes contributions and suggestions. Most contributions require
you to agree to a Contributor License Agreement (CLA) declaring that you have
the right to, and actually do, grant us the rights to use your contribution. For
details, visithttps://cla.opensource.microsoft.com.When you submit a pull request, a CLA bot will automatically determine whether
you need to provide a CLA and decorate the PR appropriately (e.g., status check,
comment). Simply follow the instructions provided by the bot. You will only need
to do this once across all repos using our CLA.This project has adopted theMicrosoft Open Source Code of Conduct.
For more information see theCode of Conduct FAQor contactopencode@microsoft.comwith any additional questions or comments.Related PapersContainer Inventory ManagementWenlei Shi, Xinran Wei, Jia Zhang, Xiaoyuan Ni, Arthur Jiang, Jiang Bian, Tie-Yan Liu. “Cooperative Policy Learning with Pre-trained Heterogeneous Observation Representations“. AAMAS 2021Xihan Li, Jia Zhang, Jiang Bian, Yunhai Tong, Tie-Yan Liu. “A Cooperative Multi-Agent Reinforcement Learning Framework for Resource Balancing in Complex Logistics Network“. AAMAS 2019Related NewsMSRA Top-10 Hack-Techs in 2021Open Source Platform MARO: Anywhere Door for Resource OptimizationAI from “Point” to “Surface”Cite UsLicenseCopyright (c) Microsoft Corporation. All rights reserved.Licensed under theMITLicense.