Reinforcement Learning for Real-time Inventory Optimization
Simulation Active
๐ค
AI Optimization Engine
RL Agent Active - Q-Learning
โน๏ธ
Optimal Order Qty
245
Current: 200-45
Optimal Reorder Pt
165
Current: 100-65
๐
Simulation Control
SpeedNormal
๐
Demand Parameters
Mean Demand (ฮผ)units/day50
Std Dev (ฯ)units10
๐ฆ
Inventory Policy
Order Quantity (Q)units200
Reorder Point (s)units100
โฑ๏ธ
Lead Time
Mean Lead Time (ฮผ)days3
Std Dev (ฯ)days1
0
๐
๐
Avg Stock
0
๐ฐ
Total Cost
$0
โ
Service Level
100%
๐ฆ
Orders in Transit
0
๐
Inventory Level Timeline
Cost Distribution
Holding Cost
Order Cost
Shortage Cost
๐
Understanding the Simulation
๐ Demand Dynamics
Daily demand follows a normal distribution with mean (ฮผ) and standard deviation (ฯ). This stochastic nature represents real-world uncertainty in customer orders. Higher ฯ means more volatile demand patterns.
Daily Demand ~ N(ฮผ, ฯยฒ)
๐ฆ Inventory Policy (Q,r)
The system uses a continuous review policy: when inventory position drops to or below the reorder point (s), a fixed quantity (Q) is ordered. This balances holding costs with stockout risks.
If (Inventory + Pipeline) โค s โ Order Q units
๐ Lead Time Variability
Delivery times are stochastic, following a normal distribution. This uncertainty affects safety stock requirements and increases the complexity of inventory management.
Lead Time ~ N(ฮผ_L, ฯ_Lยฒ) days
๐ฐ Cost Structure
Three cost components drive decision-making:
โข Holding Cost: $2/unit/day for storage
โข Order Cost: $100 fixed per order
โข Shortage Cost: $10/unit for lost sales
๐ค AI Optimization Engine
The Reinforcement Learning agent uses Q-Learning to discover optimal parameters. It combines EOQ calculations with safety stock analysis, then adjusts based on real-time performance metrics.
Q* = โ(2DK/h) ร RL_adjustment
๐ Performance Metrics
โข Service Level: % of demand fulfilled immediately
โข Average Stock: Mean inventory level over time
โข Total Cost: Sum of all cost components
โข Pipeline Orders: In-transit inventory
๐ Simulation Objective: Find the optimal balance between inventory investment and customer service. The AI agent learns from cost patterns and continuously improves its recommendations. Watch how the green optimal lines adapt as the simulation progresses, demonstrating real-time machine learning in action.
๐ง
Reinforcement Learning: Q-Learning Algorithm
๐ฏ How Q-Learning Works
Q-Learning is a model-free reinforcement learning algorithm that learns optimal actions through trial and error:
State (S): Current inventory level & demand pattern
Action (A): Set Q (order quantity) and s (reorder point)
Reward (R): Negative total cost (minimize costs)
Q-Table: Stores value of each state-action pair
๐ Learning Process
The AI agent continuously improves through these steps:
Exploration: Trying new Q,s combinations to discover better policies
Exploitation: Using the best-known parameters for optimal performance
This ฮต-greedy strategy ensures continuous learning and adaptation to changing conditions.
๐ก Real-time Adaptation
Our simulator demonstrates RL in action:
Monitors cost patterns every 50 days
Adjusts recommendations based on service level
Learns from stockout incidents
Optimizes for total cost minimization
๐ฎ Interactive Learning:
As you adjust parameters, the Q-Learning agent observes the outcomes and refines its recommendations. The green AI indicators show where the algorithm believes optimal values lie based on accumulated experience. Click "Apply AI" to instantly apply the learned optimal parameters and observe the performance improvement!