MARO Python Package
Project description
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 as container inventory management in logistics, bike repositioning in transportation, virtual machine provisioning in data centers, and asset management in finance. Besides Reinforcement Learning (RL), it also supports other planning/decision mechanisms, such as Operations 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.
Contents
File/folder |
Description |
---|---|
maro |
MARO source code. |
docs |
MARO docs, it is host on readthedocs. |
examples |
Showcase of MARO. |
notebooks |
MARO quick-start notebooks. |
Try `MARO playground <#run-playground>`_ to have a quick experience.
Install MARO from PyPI
Notes: 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 / Linux
pip install pymaro
Windows
# Install torch first, if you don't have one. pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html pip install pymaro
Install MARO from Source
Notes: Install from source if you want to use the CLI commands (including the visualization tool).
Prerequisites
C++ Compiler
Linux or Mac OS X: gcc
Windows: Build Tools for Visual Studio 2017
Enable Virtual Environment
Mac OS / Linux
# If your environment is not clean, create a virtual environment firstly. python -m venv maro_venv source ./maro_venv/bin/activate
Windows
# If your environment is not clean, create a virtual environment firstly. python -m venv maro_venv # You may need this for SecurityError in PowerShell. Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted # Activate the virtual environment. .\maro_venv\Scripts\activate
Install MARO
# Git Clone the whole source code. git clone https://github.com/microsoft/maro.git
Mac OS / Linux
# Install MARO from source. bash scripts/install_maro.sh
Windows
# Install MARO from source. .\scripts\install_maro.bat
Notes: If your package is not found, remember to set your PYTHONPATH
Mac OS / Linux
export PYTHONPATH=PATH-TO-MARO
Windows
$Env:PYTHONPATH=PATH-TO-MARO
Quick Example
from maro.simulator import Env
env = Env(scenario="cim", topology="toy.5p_ssddd_l0.0", start_tick=0, durations=100)
metrics, decision_event, is_done = env.step(None)
while not is_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 instance
env = 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 data
maro inspector dashboard --source_path ./dump_data/YOUR_SNAPSHOT_DUMP_FOLDER
Show Cases
Run Playground
Pull from Docker Hub
# Pull the docker image from docker hub docker pull maro2020/playground # Run playground container. # Redis commander (GUI for redis) -> http://127.0.0.1:40009 # Jupyter lab with maro -> http://127.0.0.1:40010 docker run -p 40009:40009 -p 40010:40010 maro2020/playground
Build from source
Mac 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:40010 docker run -p 40009:40009 -p 40010:40010 maro2020/playground
Windows
# 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:40010 docker run -p 40009:40009 -p 40010:40010 maro2020/playground
Contributing
This 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, visit https://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 the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Cite Us
License
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pymaro-0.3.2a4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: pymaro-0.3.2a4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5ba978274504384b2292694720476d1611f4f3db0fc31743a61506a9ba0bad5 |
|
MD5 | 49c01099d53b4dc80044322d6375c31c |
|
BLAKE2b-256 | ff472523ea2d268d4ff2bef34b61572222e12fbd912cf67364b60e83ac764b02 |
File details
Details for the file pymaro-0.3.2a4-cp39-cp39-macosx_11_0_x86_64.whl
.
File metadata
- Download URL: pymaro-0.3.2a4-cp39-cp39-macosx_11_0_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.9, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1e1915d43b6e4c73a62632ea4a796b3c653547d27a19cb117886c6eb3f0bb7b |
|
MD5 | deb518e2d119375946c9f6408cdbb7ea |
|
BLAKE2b-256 | 770584eef41c85e69c70395fb0436a50f335e3725e68c1f872821c9c175ef108 |
File details
Details for the file pymaro-0.3.2a4-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: pymaro-0.3.2a4-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab27eadc5184e025574ffffe29e968b5885e647ce46a885da3a5223fae24b4ed |
|
MD5 | 4c688405d8998c7b8bb55d29bdbc6556 |
|
BLAKE2b-256 | 21b019bc5baf07573016fcb8204fb33cce02218aa20ded1082e6b777dfdd66e7 |
File details
Details for the file pymaro-0.3.2a4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: pymaro-0.3.2a4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d82abeead38bc40ae1345206cd35cf49eb5165d5e8acc7e8b08c1418cfc049da |
|
MD5 | a5b4399236e1aee90d0fe5980311fe86 |
|
BLAKE2b-256 | c2032f6e1cc8ffa8e45805992feb5aeeff4ece0f604ec1c344ee74cbd55d45ac |
File details
Details for the file pymaro-0.3.2a4-cp38-cp38-macosx_11_0_x86_64.whl
.
File metadata
- Download URL: pymaro-0.3.2a4-cp38-cp38-macosx_11_0_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d224c3de55cd4b3155135e30b584816ad357ec7abf538a76688ee812c57cfa4 |
|
MD5 | e9935a33fce70ae1aa62e349f2cbd6a5 |
|
BLAKE2b-256 | e14a43d4bf5c3180f363368aa9352ba59317db8d1c39bc5fb3ec29d2c66e381b |
File details
Details for the file pymaro-0.3.2a4-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: pymaro-0.3.2a4-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21b0b286032200e4837596135e1677eed16272b8d582aec2fae6cf28e9cbf1bf |
|
MD5 | 2ded632659c810c27a39fa54c7c3e1f5 |
|
BLAKE2b-256 | 983d663b9aaa5269a8a53e5ed5176173f1973b3ac28eb77a9f83fc8d709dd01d |
File details
Details for the file pymaro-0.3.2a4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: pymaro-0.3.2a4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1cc61a53380899b299cfac6b4f8005a4d0864e8014fa5d207385f990a3d38bf |
|
MD5 | 67aafc091109f03873913971c35a2dba |
|
BLAKE2b-256 | 03da0dcd1204b1ac5e6fa448c16e95da6fdc86a6b6406efeb622a016927fee24 |
File details
Details for the file pymaro-0.3.2a4-cp37-cp37m-macosx_11_0_x86_64.whl
.
File metadata
- Download URL: pymaro-0.3.2a4-cp37-cp37m-macosx_11_0_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.7m, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10a66ee566cd6785c5f89118f31498e730687e721d3c88dc8a06437f50e30145 |
|
MD5 | 295dee3b8b4ec2e7e08e2b4e8bb15d32 |
|
BLAKE2b-256 | 2980c299d8ecbac3759a938eb59ea1e3f1681ac0f159e3a5f789c4a9311d0511 |