connector/config.example.json to connector/config.json, add your system under "sources" (examples below), set the secret environment variables and a CONNECTOR_API_KEY (16+ characters).python3 connector/server.py --check-source erp (or --check for NetSuite column discovery).python3 connector/server.py. Then enter its address and key below.db folder.| X | Y | Z | |
|---|---|---|---|
| A | |||
| B | |||
| C |
sku (part or item number), so use the same one in every file.Daily demand d = D/365, daily σd = σmonth/√30.4 Lead-time demand σLT = √( L·σd² + d²·σL² ) Safety stock SS = z·σLT, reorder point r = d·L + SS Loss function G(z) = φ(z) − z·(1 − Φ(z)) (expected shortage per cycle = σLT·G(z)) Total cost TC(Q,z) = S·D/Q + h·(Q/2 + z·σLT) + π·(D/Q)·σLT·G(z) Optimality: Q* = √( 2D·(S + π·σLT·G(z)) / h ), 1 − Φ(z*) = h·Q*/(π·D) Fill rate = 1 − σLT·G(z)/Q
Offered load a = λ/μ, utilization ρ = a/c (must be < 1) Erlang B recursion: B(0)=1, B(k) = a·B(k−1) / (k + a·B(k−1)) Erlang C (probability of waiting): C = B(c) / (1 − ρ·(1 − B(c))) M/M/c wait: Wq = C / (cμ − λ) G/G/c (Allen–Cunneen): Wq ≈ Wq(M/M/c) · (ca² + cs²) / 2 Little's Law: Lq = λ·Wq, WIP L = λ·(Wq + 1/μ) Tail (approx): P(Wait > t) ≈ C · exp( −t · C / Wq ) Cost per hour = c·(server cost) + λ·Wq·(waiting cost)
minimize Σi Σj cij · xij
subject to Σj xij ≤ capacity_i (each supplier)
Σi xij = demand_j (each plant)
xij ≥ 0
cij = price_i · (1 + duty_i + added tariff_i) + freight_ij
Solved exactly as min-cost flow by successive shortest paths (SPFA); a penalty supplier absorbs any unmet demand.
Naive: ŷt = yt−1 Seasonal naive: ŷt = yt−m Moving average: mean of last k SES: lt = α·yt + (1−α)·lt−1 forecast = lt Holt: adds trend bt = β(lt − lt−1) + (1−β)bt−1 forecast = lt + h·bt Holt-Winters (additive): adds seasonal st = γ(yt − lt) + (1−γ)st−m ; forecast = lt + h·bt + st+h−m Parameters tuned by grid search on training window (min squared error); scored on holdout: WAPE = Σ|e| / Σy, bias = Σ(ŷ − y) / Σy, tracking signal = Σe / MAD Safety stock scales with forecast-error σ, so SS reduction ≈ 1 − RMSE(best)/RMSE(naive)
maximize Σj mj·xj
subject to Σj aij·xj ≤ Ri (hours on resource i)
xj ≤ demandj, xj ≥ 0
Solved with the primal simplex method. Dual values y*i are shadow prices:
y*i = extra contribution margin from one more hour on resource i (zero if not a bottleneck).
maximize Σ (R − cost) · x(f, k, t, u) x = units of family f made in month t (k: regular / overtime) to serve demand of month u
cost = hours/unit × labor rate × (1 + overtime premium if k = overtime)
+ holding × unit cost × (u − t) if u ≥ t (made early, held in stock)
+ late penalty × price × (t − u) if u < t (made late, backlogged)
subject to Σ x(f, ·, ·, u) + opening stock used ≤ demand(f, u) (+ safety-stock build in month 1)
Σ hours/unit × x(·, regular, t, ·) ≤ regular hours(t); Σ … x(·, overtime, t, ·) ≤ overtime hours(t)
Solved exactly with the simplex method. Compared with level (constant output) and chase (output follows demand) plans.
Low-level code: each item is planned after every parent that uses it. For each week t: net = max(0, gross + safety stock − (projected on hand + scheduled receipt)) planned receipt = lot-sized(net) [L4L: net; FOQ: ceil(net / lot) × lot; MOQ: max(net, lot)] projected on hand = on hand + receipts + planned receipt − gross planned release week = t − lead time (before week 1 = late, flagged for expediting) component gross requirement = Σ parent planned releases × quantity per
Score = Σ weight × metric, each metric scaled 0–100: on-time %, quality = 100 − 10 × defect %, price = 100 − 3 × (index − 90), lead-time stability = 100 − 4 × variability %, responsiveness = (rating − 1)/4 Quote total = D·p·(1 − r·terms/365) + D·(freight + p·duty) + S·D/Q + h·landed·(Q/2 + z·σ·√L) Price breaks (all-units): TC(Q) = D·p(Q) + S·D/Q + h·p(Q)·Q/2, minimized over each break quantity and its EOQ Spend concentration: HHI = Σ (supplier share)²
d = daily usage × (1 + scenario %) days of supply = on hand / d next supply arrives at day t = open-PO due date (if on order) else lead time L (order placed today) Shortage days = max(0, t − days of supply); shortage units = d × shortage days Status: Short if shortage days > 0; At risk if (on hand + on order)/d < L + buffer; Excess if (on hand + on order)/d > excess threshold Recommended order = max(0, d·(L + target cover) − on hand − on order); excess units = on hand + on order − d·target cover
σpool² = (1−ρ)·Σσi² + ρ·(Σσi)² (regional demand correlation ρ) Regions hold all buffer: SS = z · Σσi · √(Lc + Lr) Central pooling: SS = z · Σσi · √Lr + z · σpool · √Lc Full centralization: SS = z · σpool · √(Lc + Ld) + freight premium · annual demand
Planning models using stated assumptions (normal demand, Poisson-like arrivals with variability adjustment). Validate inputs against your own data before acting. Not legal, customs, or tax advice. © Statadventure