RSOME案例:多阶段库存控制

本文通过RSOME库展示如何在多阶段库存控制问题中应用不同的分布鲁棒模型。采用非平稳自回归过程描述需求,并通过部分交叉矩、类型-1和类型-∞ Wasserstein度量构建不确定性集合,探讨了不同场景下的决策优化。
摘要由CSDN通过智能技术生成


RSOME: Robust Stochastic Optimization Made Easy


Multi-Stage Inventory Control

In this example we consider a multi-stage inventory control problem to showcase how different distributionally
robust models can be deployed in RSOME with little switching cost. The inventory control problem assumes that at the beginning of each time period t ∈ [ T ] t\in[T] t[T], the decision maker starts with I 0 I_{0} I0 units of product in inventory and selects a production quantity x t ∈ [ 0 , x ˉ t ] x_t \in [0, \bar{x}_t] xt[0,xˉt] with zero lead time at a unit cost c t c_t ct. After realization of demand d t ≥ 0 d_t \geq 0 dt0, the inventory is updated to I t = I t − 1 + x t − d t I_t = I_{t−1}+x_t −d_t It=It1+xtdt and it may incur a holding cost of h t max ⁡ { I t , 0 } h_t \max\{I_t, 0\} htmax{ It,0} or a backorder cost of b t max ⁡ { − I t , 0 } b_t \max\{−I_t, 0\} btmax{ It,0}. We use the same parameters and data generation as in See and Sim (2010). Specifically, the demand follows a non-stationary autoregressive stochastic process of the form:

d ~ t ( v ) = v ~ t + α v ~ t − 1 + α v ~ t − 2 + ⋯ + α v ~ 1 + μ = d t − 1 ( v ~ ) − ( 1 − α ) v ~ t − 1 + v ~ t     ∀ t ∈ [ T ] , \tilde{d}_t(\pmb{v}) = \tilde{v}_t + \alpha \tilde{v}_{t-1} + \alpha \tilde{v}_{t-2} + \cdots + \alpha \tilde{v}_1 + \mu = d_{t-1}(\tilde{\pmb{v}}) - (1-\alpha)\tilde{v}_{t-1} + \tilde{v}_t ~~~\forall t \in [T], d~t(vvv)=v~t+αv~t1+αv~t2++αv~1+μ=dt1(vvv~)(1α)v~t1+v~t   t[T],

where v ~ 1 , … , v ~ T \tilde{v}_1,\dots,\tilde{v}_T v~1,,v~T are independent and identically distributed uniform random variables in [ − v ˉ , v ˉ ] [-\bar{v}, \bar{v}] [vˉ,vˉ], and other parameters are given as:

  • Number of time steps: T = 10 T=10 T=10.
  • Constant in the autoregressive process: α = 0.25 \alpha=0.25 α=0.25.
  • Initial inventory status: I 0 = 0 I_0=0 I0=0.
  • Bounds of each random variable: v ˉ = 10 \bar{v}=10 vˉ=10.
  • Mean demand: μ t = 200 \mu_t=200 μt=200.
  • Upper bound of the order quantity: x ˉ t = 260 \bar{x}_t=260 xˉt=260.
  • Order cost: c t = 0.1 c_t=0.1 ct=0.1.
  • Holding cost: h t = 0.02 h_t=0.02 ht=0.02.
  • Backorder cost: b t = 0.4 b_t=0.4 bt=0.4 if t = 1 , 2 , ⋯   , T − 1 t=1, 2, \cdots, T-1 t=1,2,,T1, and b T = 4.0 b_T=4.0 bT=4.0.

These parameters are defined by the code segment below.

import numpy as np

T = 10		
alpha = 0.25
I0 = 0
vbar = 10
mu = 200 * np.ones(T)
xbar = 260 * np.ones(T)
c = 0.1 * np.ones(T)
h = 0.02 * np.ones(T)
b = 0.4 * np.ones(T)
b[T-1] = 4.0

With a null inventory on hand (i.e, I 0 = 0 I_0= 0 I0=0), the decision maker dynamically selects production quantities to minimize the expected total cost over the entire planning horizon, given by

min ⁡ x ,   y   sup ⁡ P ∈ F E P [ c 1 x 1 + ∑ t ∈ [ T ] ∖ { 1 } c t x t ( s ~ , z ~ ) + ∑ t ∈ [ T ] y t ( s ~ , z ~ ) ] s.t.  I 1 ( s , z ) = I 0 + x 1 − d 1 ( s , z ) ∀ z ∈ Z s ,    s ∈ [ S ] I t ( s , z ) = I t − 1 ( s , z ) + x t ( s , z ) − d t ( s , z ) ∀ z ∈ Z s ,    s ∈ [ S ] ,    t ∈ [ T ] ∖ { 1 } y t ( s , z ) ≥ h t I t ( s , z ) ∀ z ∈ Z s ,    s ∈ [ S ] ,    t ∈ [ T ] y t ( s , z ) ≥ − b t I t ( s , z ) ∀ z ∈ Z s ,    s ∈ [ S ] ,    t ∈ [ T ] 0 ≤ x 1 ≤ x ˉ 1 0 ≤ x t ( s , z ) ≤ x ˉ t ∀ z ∈ Z s ,    s ∈ [ S ] ,    t ∈ [ T ] ∖ { 1 } x t ∈ A ‾ ( C , J t − 1 ) ∀ t ∈ [ T ] ∖ { 1 } y t ,    I t ∈ A ‾ ( C , J t ) , ∀ t ∈ [ T ] . \begin{aligned} \min_{\bm{x}, ~\bm{y}} ~& \sup_{\mathbb{P} \in \mathcal{F}}\mathbb{E}_{\mathbb{P}}\left[c_1 x_1 + \sum_{t\in[T]\setminus\{1\}}c_t x_t(\tilde{s}, \tilde{\pmb{z}}) + \sum_{t\in[T]}y_t(\tilde{s}, \tilde{\pmb{z}})\right] \hspace{-0.4in} &\\ \text{s.t.}~ & I_1(s, \pmb{z}) = I_0 + x_1 - d_{1}(s, \pmb{z}) & \forall \pmb{z} \in \mathcal{Z}_s, \; s \in [S] \\ &I_t(s, \pmb{z}) = I_{t-1}(s, \pmb{z}) + x_t(s, \pmb{z}) - d_t(s, \pmb{z}) & \forall \pmb{z} \in \mathcal{Z}_s, \; s \in [S], \; t \in [T]\setminus\{1\} \\ &y_t(s, \pmb{z}) \geq h_t I_t(s, \pmb{z}) & \forall \pmb{z} \in \mathcal{Z}_s, \; s \in [S], \; t \in [T] \\ &y_t(s, \pmb{z}) \geq -b_t I_t(s, \pmb{z}) & \forall \pmb{z} \in \mathcal{Z}_s, \; s \in [S], \; t \in [T] \\ & 0 \leq x_1 \leq \bar{x}_1 \\ & 0 \leq x_t(s, \pmb{z}) \leq \bar{x}_t & \forall \pmb{z} \in \mathcal{Z}_s, \; s\in [S], \; t \in [T]\setminus\{1\} \\ & x_t \in \overline{\mathcal{A}}(\mathcal{C}, \mathcal{J}_{t-1}) &\forall t \in [T]\setminus\{1\} \\ & y_t, \; I_t \in \overline{\mathcal{A}}(\mathcal{C}, \mathcal{J}_t), &\forall t \in [T]. \end{aligned} x, ymin s.t. PFsupEPc

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值