§4.1, (28)–(31) and (34): echelon stocks, coupling constraint and the supply chain with the modified demands
DefinitionRobustInventory_SingleStation_Supplement_NetworkDynamicsThis file defines the stock dynamics of the tree network and the deterministic supply chain with modified demands. Let be the order of echelon to its only supplier.
The nominal echelon stock is . An order array is feasible if for every echelon and period, plant links included, and, for every installation that is not a sink,
The right-hand side is the stock on hand of installation . It does not depend on demand, and this constraint makes it nonnegative.
With the value of LP (13) at sink , echelon sees at sink the modified demand (34)
and its modified stock is . The modified supply chain minimizes over the feasible order arrays.
Formalization Note Constraint (31) is not imposed at a sink, where its empty left side would forbid the backlog that §4.1 allows. It is written with as printed, also in the modified supply chain: substituting would change the physical stock on hand, because the modification depends on the echelon.
import Definitions.Def_RobustInventory_SingleStation_Supplement_Network
namespace RobustInventory.SingleStation.Supplement.Network
open Finset
variable (G : Network)
/-- The nominal stock `X̄_k(t)` of echelon `k` at the beginning of period `t`, as below (31):
`X_k(0) + ∑_{τ<t} (D_k(τ) - ∑_{s ∈ O(k)} W̄_s(τ))`. Here `D k τ` is the order `D_{i_k k}(τ)` of
echelon `k` to its only supplier. -/
noncomputable def Xbar (D : Fin G.N → ℕ → ℝ) (k : Fin G.N) (t : ℕ) : ℝ :=
G.X0 k + ∑ τ ∈ Finset.range t, (D k τ - ∑ s ∈ G.tree.sinksBelow k, G.Wbar s τ)
/-- The constraints of (32) on the orders alone: `D ≥ 0`, plant links included, and, for every
installation `k` that is not a sink, the coupling constraint (31)
`∑_{i ∈ N(k)} D_ki(t) ≤ X̄_k(t) - ∑_{i ∈ N(k)} X̄_i(t)`. A sink may backlog, so (31) is not
imposed on it. -/
def OrdersFeasible (D : Fin G.N → ℕ → ℝ) : Prop :=
(∀ i, ∀ t < G.T, 0 ≤ D i t) ∧
∀ k, ¬ G.tree.IsSink k → ∀ t < G.T,
∑ i ∈ G.tree.children k, D i t ≤ G.Xbar D k t - ∑ i ∈ G.tree.children k, G.Xbar D i t
/-- (34): the modified demand `W'_{s,k}(t)` that echelon `k` sees at sink `s`. -/
noncomputable def Wmod (s k : Fin G.N) (t : ℕ) : ℝ :=
G.Wbar s t + (G.p k - G.h k) / (G.p k + G.h k) * (G.A s t - G.Aprev s t)
/-- The modified stock `X'_k(t) = X_k(0) + ∑_{τ<t} (D_k(τ) - ∑_{s ∈ O(k)} W'_{s,k}(τ))`. -/
noncomputable def Xmod (D : Fin G.N → ℕ → ℝ) (k : Fin G.N) (t : ℕ) : ℝ :=
G.X0 k + ∑ τ ∈ Finset.range t, (D k τ - ∑ s ∈ G.tree.sinksBelow k, G.Wmod s k τ)
/-- The cost of the deterministic supply chain with the modified demands (34):
`∑_t ∑_k (C_k(D_k(t)) + max(h_k X'_k(t+1), -p_k X'_k(t+1)))`, over all `N` echelons. -/
noncomputable def modifiedCost (D : Fin G.N → ℕ → ℝ) : ℝ :=
∑ t ∈ Finset.range G.T, ∑ k, (G.C k (D k t) + G.R k (G.Xmod D k (t + 1)))
/-- A global minimizer of the deterministic supply chain with the modified demands (34), under
the order constraints of (32). These constraints do not depend on the demand. -/
def IsModifiedOptimal (D : Fin G.N → ℕ → ℝ) : Prop :=
G.OrdersFeasible D ∧ ∀ D', G.OrdersFeasible D' → G.modifiedCost D ≤ G.modifiedCost D'
end RobustInventory.SingleStation.Supplement.Network