# Gymnasium-Compatible Inventory Management Environments & Benchmarks (or-gym-inventory)
This repository provides `or_gym_inventory`, an installable Python package containing implementations of classic inventory management environments. These environments are adapted from the original [OR-Gym library](https://github.com/hubbs5/or-gym) and updated for compatibility with the [Gymnasium](https://gymnasium.farama.org/) API (the successor to OpenAI Gym).
The package also includes comprehensive benchmarking scripts (located in the `examples/` directory of the source repository) to compare various heuristic, optimization-inspired, and Reinforcement Learning (RL) policies on these environments.
**Environments Included:**
1. **Newsvendor (`or_gym_inventory.newsvendor`):** Multi-period newsvendor problem with lead times and stochastic Poisson demand (based on Zipkin (2000, 2008), and Balaji et al. 2019, https://arxiv.org/abs/1911.10641). Class: `NewsvendorEnv`.
2. **Inventory Management (`or_gym_inventory.inventory_management`):** Multi-period, multi-echelon inventory system for a single product (based on Paul Glasserman and Sridhar Tayur (1995) and D. Hubbs (2020)). Includes `InvManagementBacklogEnv` and `InvManagementLostSalesEnv`.
3. **Network Inventory Management (`or_gym_inventory.network_management`):** Multi-period, multi-node inventory system with a network structure (factories, distributors, retailers, markets). Includes `NetInvMgmtBacklogEnv` and `NetInvMgmtLostSalesEnv` (based on Paul Glasserman and Sridhar Tayur (1995) and Perez et al. (2021)).
## Features
* **Installable Package:** Easily install using pip (`pip install or_gym_inventory`).
* **Gymnasium Compatible:** Environments adhere to the modern Gymnasium API standard (`reset` returns `obs, info`, `step` returns `obs, reward, terminated, truncated, info`).
* **Three Core Environments:** Covers single-item, multi-echelon, and network inventory problems.
* **Backlog & Lost Sales Variants:** Specific environment classes (`*BacklogEnv`, `*LostSalesEnv`) implement these dynamics.
* **Comprehensive Benchmarking Examples:** Includes dedicated scripts (`examples/benchmark_*.py` in the source repo) comparing various agents:
* **Baselines:** Random Agent.
* **Heuristics:** Relevant heuristics adapted for each environment type (e.g., Order-Up-To, Classic Newsvendor, (s,S) for Newsvendor; Base Stock, Constant Order for multi-echelon/network).
* **Stable Baselines3 Agents:** PPO, SAC, TD3, A2C, DDPG examples.
* **Ray RLlib Agents:** PPO, SAC examples.
* **Detailed Reporting (from Benchmarks):** Benchmark examples generate:
* Summary tables (CSV).
* Raw results per episode (CSV).
* Detailed step-by-step data (optional, JSON Lines).
* Comparison plots (PNG).
## Installation
You can install the core package using pip:
```bash
pip install or_gym_inventory
Raw data
{
"_id": null,
"home_page": null,
"name": "or-gym-inventory",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "reinforcement learning, operations research, inventory management, gymnasium, rl",
"author": null,
"author_email": "Reza Barati <r2barati@torontomu.ca>",
"download_url": "https://files.pythonhosted.org/packages/60/44/20c4cf33a99008d6aa33306d1ccae4915ffe751642d4b0eac583c1181cab/or_gym_inventory-1.0.0.tar.gz",
"platform": null,
"description": "# Gymnasium-Compatible Inventory Management Environments & Benchmarks (or-gym-inventory)\n\nThis repository provides `or_gym_inventory`, an installable Python package containing implementations of classic inventory management environments. These environments are adapted from the original [OR-Gym library](https://github.com/hubbs5/or-gym) and updated for compatibility with the [Gymnasium](https://gymnasium.farama.org/) API (the successor to OpenAI Gym).\n\nThe package also includes comprehensive benchmarking scripts (located in the `examples/` directory of the source repository) to compare various heuristic, optimization-inspired, and Reinforcement Learning (RL) policies on these environments.\n\n**Environments Included:**\n1. **Newsvendor (`or_gym_inventory.newsvendor`):** Multi-period newsvendor problem with lead times and stochastic Poisson demand (based on Zipkin (2000, 2008), and Balaji et al. 2019, https://arxiv.org/abs/1911.10641). Class: `NewsvendorEnv`.\n2. **Inventory Management (`or_gym_inventory.inventory_management`):** Multi-period, multi-echelon inventory system for a single product (based on Paul Glasserman and Sridhar Tayur (1995) and D. Hubbs (2020)). Includes `InvManagementBacklogEnv` and `InvManagementLostSalesEnv`. \n3. **Network Inventory Management (`or_gym_inventory.network_management`):** Multi-period, multi-node inventory system with a network structure (factories, distributors, retailers, markets). Includes `NetInvMgmtBacklogEnv` and `NetInvMgmtLostSalesEnv` (based on Paul Glasserman and Sridhar Tayur (1995) and Perez et al. (2021)).\n\n## Features\n\n* **Installable Package:** Easily install using pip (`pip install or_gym_inventory`).\n* **Gymnasium Compatible:** Environments adhere to the modern Gymnasium API standard (`reset` returns `obs, info`, `step` returns `obs, reward, terminated, truncated, info`).\n* **Three Core Environments:** Covers single-item, multi-echelon, and network inventory problems.\n* **Backlog & Lost Sales Variants:** Specific environment classes (`*BacklogEnv`, `*LostSalesEnv`) implement these dynamics.\n* **Comprehensive Benchmarking Examples:** Includes dedicated scripts (`examples/benchmark_*.py` in the source repo) comparing various agents:\n * **Baselines:** Random Agent.\n * **Heuristics:** Relevant heuristics adapted for each environment type (e.g., Order-Up-To, Classic Newsvendor, (s,S) for Newsvendor; Base Stock, Constant Order for multi-echelon/network).\n * **Stable Baselines3 Agents:** PPO, SAC, TD3, A2C, DDPG examples.\n * **Ray RLlib Agents:** PPO, SAC examples.\n* **Detailed Reporting (from Benchmarks):** Benchmark examples generate:\n * Summary tables (CSV).\n * Raw results per episode (CSV).\n * Detailed step-by-step data (optional, JSON Lines).\n * Comparison plots (PNG).\n\n## Installation\n\nYou can install the core package using pip:\n\n```bash\npip install or_gym_inventory\n",
"bugtrack_url": null,
"license": null,
"summary": "Gymnasium-compatible implementations of classic inventory management environments (Newsvendor, Multi-Echelon, Network) based on OR-Gym.",
"version": "1.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/r2barati/or-gym-inventory-pkg/issues",
"Homepage": "https://github.com/r2barati/or-gym-inventory-pkg"
},
"split_keywords": [
"reinforcement learning",
" operations research",
" inventory management",
" gymnasium",
" rl"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e025691999a41a2f3d4d68570c15b5c919dd2a804fcabd15f3c19511acae032a",
"md5": "557b8eb4c267b180e7fe676e844fe823",
"sha256": "edb95db8c1a3f4d4bbc5fd1129e98c68ceee644ec05ec98811bc828bc29ce88b"
},
"downloads": -1,
"filename": "or_gym_inventory-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "557b8eb4c267b180e7fe676e844fe823",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 27645,
"upload_time": "2025-07-12T07:31:23",
"upload_time_iso_8601": "2025-07-12T07:31:23.018414Z",
"url": "https://files.pythonhosted.org/packages/e0/25/691999a41a2f3d4d68570c15b5c919dd2a804fcabd15f3c19511acae032a/or_gym_inventory-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "604420c4cf33a99008d6aa33306d1ccae4915ffe751642d4b0eac583c1181cab",
"md5": "86168d370388155c64928095eefecc04",
"sha256": "22ab96f8dae3248e4350545215a297026ae7cecfe1591dd52c5e5f658594716b"
},
"downloads": -1,
"filename": "or_gym_inventory-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "86168d370388155c64928095eefecc04",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 26747,
"upload_time": "2025-07-12T07:31:24",
"upload_time_iso_8601": "2025-07-12T07:31:24.331393Z",
"url": "https://files.pythonhosted.org/packages/60/44/20c4cf33a99008d6aa33306d1ccae4915ffe751642d4b0eac583c1181cab/or_gym_inventory-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-12 07:31:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "r2barati",
"github_project": "or-gym-inventory-pkg",
"github_not_found": true,
"lcname": "or-gym-inventory"
}