https://github.com/lukestorry/inventory-optimisation
Demo for a talk about inventory modelling and strategy optimisation in Python
https://github.com/lukestorry/inventory-optimisation
Last synced: 3 months ago
JSON representation
Demo for a talk about inventory modelling and strategy optimisation in Python
- Host: GitHub
- URL: https://github.com/lukestorry/inventory-optimisation
- Owner: LukeStorry
- Created: 2022-01-17T12:58:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-24T15:30:19.000Z (over 4 years ago)
- Last Synced: 2025-01-16T00:26:06.716Z (over 1 year ago)
- Language: HTML
- Size: 232 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Inventory-Optimisation-Demo
#### Example code for a talk about inventory modelling and strategy optimisation in Python.
Using:
- [simpy](https://simpy.readthedocs.io/en/latest/) for discrete event simulation
- [matplotlib](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html) for graphs
- [epsilon-greedy algorithm](https://en.wikipedia.org/wiki/Multi-armed_bandit#:~:text=Epsilon%2Dgreedy,-strategy) for input optimisation
- [reveal-js](https://revealjs.com/) framework for the presentation
- [excalidraw](https://excalidraw.com/) for diagrams
>Slides viewable [here](https://lukestorry.github.io/Inventory-Optimisation/slides.html)
---
## Overview

---
## Output
#### With only the Purchasing event

#### After adding aged stock clearout

#### After adding sales

#### Result of greedy-epsilon optimisation

#### Comparison of different Epsilon values (reward per iteration)

---
## Setup & running
Install required packages: `pip install -r .\requirements.txt`
Run the scripts with: `python simulation.py` or `python optimisation.py`
---
## Creating your own optimiser
Either use the simple greedy-epsilon-agent-based optimiser as a starting point, or in a new file:
```python
from simulation import PurchaseOrder, Simulation
# Initial inputs
purchase_orders = [PurchaseOrder(0, 20), PurchaseOrder(100, 100)]
for iteration in range(100):
simulation = Simulation(purchase_orders)
simulation.run()
simulation.plot()
# Customise this calculation depending on requirements
cost = sum(simulation.availabilities)
# Calculate a new set of more-optimal inputs
purchase_orders = []
```