https://github.com/d3group/ddopai

A completely new and revamped ddop. Now with AI. Documentation here: https://d3group.github.io/ddopai/

https://github.com/d3group/ddopai

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.4%) to scientific vocabulary

Keywords

inventory-management newsvendor-problem operations-research reinforcement-learning
Last synced: 9 months ago · JSON representation

Repository

A completely new and revamped ddop. Now with AI. Documentation here: https://d3group.github.io/ddopai/

Basic Info
Statistics
  • Stars: 4
  • Watchers: 3
  • Forks: 0
  • Open Issues: 2
  • Releases: 2
Topics
inventory-management newsvendor-problem operations-research reinforcement-learning
Created almost 2 years ago · Last pushed 11 months ago
Metadata Files
Readme Contributing License

README.md

ddopai

Install

sh pip install ddopai

What is ddopai?

To be written.

What is the difference to Gymnasium and how to convert Gymnasium Environments?

To make any enviroment compatible with mushroomRL and other agents defined within ddopai, there are some additional requirements when defining the environment. Instead of inheriting from gym.Env, the environment should inherit from ddopai.envs.base.BaseEnvironment. This base class provides some additional necessary methods and attributes to ensure compatibility with the agents. Below are the steps to convert a Gym environment to a ddopai environment. We strongly recommend you to also look at the implementation of the NewsvendorEnv (nbs/20environments/21envsinventory/20singleperiodenvs.ipynb) as an example.

1. Initialization and Parameter Setup

  • In the __init__ method of your environment, ensure that any environment-specific parameters are added using the set_param(...) method. This guarantees the correct types and shapes for the parameters.
  • Define the action and observation spaces using set_action_space() and set_observation_space() respectively. These should be called within the __init__ method, rather than defining the spaces directly.
  • In the __init__, and MDPInfo object needs to be created mdp_info = MDPInfo(self.observation_space, self.action_space, gamma=gamma, horizon=horizon_train)

2. Handling Train, Validation, Test, and Horizon

  • Implement or override the train(), val(), and test() methods to configure the correct datasets for each phase, ensuring no data leakage. The base class provides these methods, but you may need to adapt them based on your environment.
  • Update the mdp_info to set the horizon (episode length). For validation and testing, the horizon corresponds to the length of the dataset, while for training, the horizon is determined by the horizon_train parameter. If horizon_train is "use_all_data", the full dataset is used; if it’s an integer, a random subset is used.

3. Step Method

  • The step() method is handled in the base class, so instead of overriding it, implement a step_(self, action) method for the specific environment. This method should return a tuple: (observation, reward, terminated, truncated, info).
  • The next observation should be constructed using the get_observation() method, which must be called inside the step_() method. Make sure to correctly pass the demand (or equivalent) to the next step to calculate rewards.

4. Pre- and Post-Processing

  • Action post-processing should be done within the environment, in the step() method, to ensure the action is in the correct form for the environment.
  • Observation pre-processing, however, is handled by the agent in MushroomRL. This processing takes place in the agent’s draw_action() method.

5. Reset Method

  • The reset() method must differentiate between the training, validation, and testing modes, and it should consider the horizon_train parameter for training.
  • After setting up the mode and horizon, call reset_index() (with an integer index or "random") to initialize the environment. Finally, use get_observation() to provide the initial observation to the agent.

Owner

  • Name: D3 Group
  • Login: d3group
  • Kind: organization
  • Email: d3@uni-wuerzburg.de
  • Location: Germany

Data Driven Decisions (D3) Group - Uni Würzburg

GitHub Events

Total
  • Issues event: 2
  • Push event: 68
  • Pull request event: 16
  • Create event: 4
Last Year
  • Issues event: 2
  • Push event: 68
  • Pull request event: 16
  • Create event: 4

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 2
  • Total pull requests: 31
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 31
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 31
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 hour
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 31
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • majoma7 (2)
Pull Request Authors
  • majoma7 (35)
  • Aabhash (1)
Top Labels
Issue Labels
Pull Request Labels
documentation (1)

Dependencies

.github/workflows/deploy.yaml actions
  • fastai/workflows/quarto-ghp master composite
.github/workflows/test.yaml actions
  • fastai/workflows/nbdev-ci master composite
setup.py pypi