Warehousing

Warehousing plays a critical role in modern supply chains, serving as the hub for storing, handling, and distributing goods. Efficient warehouse operations help reduce costs, improve service levels, and ensure smooth logistics flows. Core topics include layout design, inventory control, order picking strategies, automation, and performance optimization.

1. Simulation

  • Simulation: Methods & Implementation

Inventory Simulation

SimPy-based continuous-review inventory with (r,Q) and (s,S) policies, multi-product support, and detailed cost tracking.

1) Why It Matters β€” The Cost of Poor Replenishment

Fixed rules that ignore variability cause both overstock and stockouts. In continuous-review systems these show up as unnecessary holding costs, lost sales/backorders, and too many small rush orders.

  • Overstock β†’ capital tied up & storage cost.
  • Stockouts β†’ lost sales or degraded service.
  • Unstable ordering β†’ higher setup & expediting cost.
Goal: choose reorder thresholds and policy parameters that reduce average cost while maintaining service.
Multi-product Continuous-review (r,Q) & (s,S) Stochastic demand & lead time

2) System Model β€” What We Simulate

Core assumptions

  • Demand: Poisson arrivals; each customer draws a discrete demand size.
  • Lead time: exponential per order.
  • Policy per product: (r,Q) or (s,S) (exactly one active).
  • Shortage handling: backorders or lost sales (per product).
  • Costs: holding, shortage, and ordering (setup + per unit).

What you configure

  • Review interval and horizon (periods).
  • Demand/lead distributions, Q or S, and cost rates.
  • Backlog vs. lost sales behavior.

Each period: receive due orders β†’ draw demand β†’ update stock & costs β†’ reorder if the inventory position crosses its threshold.

3) Simulation Mechanics β€” One Loop

Inventory position: \(IP_t = \text{on hand}_t + \text{outstanding}_t\).
Reorder: if \(IP_t \le r\), order \(Q\) (r,Q) or up to \(S\) (s,S).
Average cost: \(\bar C = \frac{1}{H}\sum_{t=1}^{H}(C^{hold}_t + C^{short}_t + C^{ord}_t)\).
  • Receive β†’ Demand β†’ Update β†’ Possibly reorder (per product).
  • Run for horizon \(H\); record time-series for charts (inventory, position, demand).

4) Quick Defaults (Example A & B)

Review & horizon

  • Review interval: 1 period
  • Horizon: 60 periods

Demand & lead

  • Arrivals: Poisson
  • Demand size: discrete (per product)
  • Lead time: exponential

Per-product static parameters

  • Product A β€” policy (s,S): S=50, Ξ»=10, sizes=(0.5,1,1.5), probsβ‰ˆ(β…“,β…“,β…“), LΜ„=3, costs: hold=1, short=5, setup=32, unit=3, backlog=on.
  • Product B β€” policy (r,Q): Q=15, Ξ»=8, sizes=(1,2,3), probs=(0.2,0.5,0.3), LΜ„=2, costs: hold=1, short=5, setup=32, unit=3, backlog=off.

Adjust reorder points and policy parameters in the UI; charts update using the recorded history.

5) What You See β€” Inputs & Outputs

Inputs

  • Per-product policy: choose (s,S) or (r,Q).
  • Reorder point \(r\), Up-To \(S\) or Quantity \(Q\).
  • Demand & lead distributions; cost rates; backlog option.

Outputs

  • Summary per product: avg cost, holding/shortage/ordering cost, fill rate.
  • Time-series charts: inventory, position, demand.
  • Final state: on-hand and outstanding.

6) References

Try it & Learn More

Explore the Result:

Open live sample
Built with SimPy β€” a process-based discrete-event simulator for Python.

Inventory Simulation Results

GA over reorder points β€’ Best cost, stop reason, per-product metrics

2. Simulation-Optimization

  • Sim-Opt: Methods & Implementation

Inventory Simulation ⇄ Optimization

Balance holding, shortage, and ordering costs under stochastic demand & lead times. Find robust reorder points.

1) Why It Matters β€” The Cost of Poor Replenishment

Fixed rules that ignore variability cause both overstock and stockouts. In continuous-review systems these show up as unnecessary holding costs, lost sales/backorders, and too many small rush orders.

  • Overstock β†’ capital tied up & storage cost.
  • Stockouts β†’ lost sales or service degradation.
  • Unstable ordering β†’ higher setup & expediting cost.
Goal: choose reorder points \(r_i\) (with given policies) to minimize average cost per period while maintaining strong service.
Multi-product (up to 5) Continuous-review (r,Q) & (s,S) Stochastic

2) System Model β€” What We Simulate

Core assumptions

  • Demand: Poisson arrivals Γ— discrete demand size per customer.
  • Lead time: exponential per order.
  • Policy: per-product (r,Q) or (s,S) with fixed Q or S.
  • Shortage handling: backorders or lost sales (fixed per product).
  • Costs: holding, shortage, and ordering (setup + per unit).

What you control

  • Decision variables: reorder points \(r_i\) for selected products.
  • Evaluation settings: horizon (periods) and number of replicates.
  • Everything else (prices, demand/lead distributions, Q/S) is static and reasonable by design.

We review every period (e.g., daily); deliveries arrive at sampled lead times; demand hits stock; costs accrue each step.

3) Simulation Mechanics β€” One Loop

Inventory position: \(IP_t = \text{on hand}_t + \text{outstanding}_t\).
Reorder rule: if \(IP_t \le r_i\), place order of size \(Q_i\) (r,Q) or up to \(S_i\) (s,S).
Average cost: \(\;\bar C = \frac{1}{H}\sum_{t=1}^{H}(C^{hold}_t + C^{short}_t + C^{ord}_t)\).
  • Per period: receive due orders β†’ draw demand β†’ update stock & costs β†’ possibly reorder.
  • Run for horizon \(H\); repeat over replicates and average to reduce Monte-Carlo noise.

4) Optimization β€” Genetic Algorithm (GA)

Chromosome: \(x = (r_1,\dots,r_m)\) over selected products. Objective: minimize summed average cost across products.

GA steps

  • Initialization within smart bounds per product.
  • Tournament selection, uniform crossover, per-gene mutation.
  • Elitism + random immigrants; optional adaptive mutation.

Stopping & robustness

  • Time limit ~20s or Ξ΅-convergence (patience window).
  • Each fitness = average over replicates for stability.
  • No fixed RNG seed by default β†’ genuine stochastic variability.

5) What You See β€” Inputs & Outputs

Inputs

  • Products to include (subset of five).
  • Replicates (1–20) and Horizon (10–1000).
  • GA sliders: Population size, Mutation rate, Crossover rate.

Outputs

  • Best reorder points \(r_i^*\) with per-product cost breakdown & fill rate.
  • History per generation: best/mean cost for charting.
  • Counts: evaluations, simulation runs (evals Γ— replicates), stop reason.

After optimization, you can run a simulation with the best solution to inspect detailed per-product outcomes.

6) References

Try it & Learn More

Explore the Result:

Open live sample
Built with SimPy for simulation and a genetic algorithm for optimization.

Inventory Simulation–Optimization Results

GA over reorder points β€’ Best cost, stop reason, per-product metrics