AI-Powered Supply Chain Optimizer

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

Speed Normal
๐Ÿ“Š

Demand Parameters

Mean Demand (ฮผ)units/day 50
Std Dev (ฯƒ)units 10
๐Ÿ“ฆ

Inventory Policy

Order Quantity (Q)units 200
Reorder Point (s)units 100
โฑ๏ธ

Lead Time

Mean Lead Time (ฮผ)days 3
Std Dev (ฯƒ)days 1
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:
Q(s,a) โ† Q(s,a) + ฮฑ[R + ฮณยทmax Q(s',a') - Q(s,a)]
Where:
  • ฮฑ: Learning rate (how fast to adapt)
  • ฮณ: Discount factor (future reward importance)
  • max Q(s',a'): Best future action value

๐Ÿš€ Exploration vs Exploitation

The agent balances between:
  • 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!