Skip to main content

Gymnasium-compatible implementations of classic inventory management environments (Newsvendor, Multi-Echelon, Network) based on OR-Gym.

Project description

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 and updated for compatibility with the Gymnasium 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:

pip install or_gym_inventory

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

or_gym_inventory-1.0.0.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

or_gym_inventory-1.0.0-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file or_gym_inventory-1.0.0.tar.gz.

File metadata

  • Download URL: or_gym_inventory-1.0.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for or_gym_inventory-1.0.0.tar.gz
Algorithm Hash digest
SHA256 22ab96f8dae3248e4350545215a297026ae7cecfe1591dd52c5e5f658594716b
MD5 86168d370388155c64928095eefecc04
BLAKE2b-256 604420c4cf33a99008d6aa33306d1ccae4915ffe751642d4b0eac583c1181cab

See more details on using hashes here.

File details

Details for the file or_gym_inventory-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for or_gym_inventory-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edb95db8c1a3f4d4bbc5fd1129e98c68ceee644ec05ec98811bc828bc29ce88b
MD5 557b8eb4c267b180e7fe676e844fe823
BLAKE2b-256 e025691999a41a2f3d4d68570c15b5c919dd2a804fcabd15f3c19511acae032a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page