Skip to content

Orchestrator

polars_ts.supply_chain_agents.orchestrator

SupplyChainOrchestrator: demand sensing -> inventory -> echelon coordination.

SupplyChainResult dataclass

Output of a :class:SupplyChainOrchestrator run.

Attributes

sensed_demand Signal- and promotion-adjusted demand forecast. promo_lift Estimated multiplicative promotion lift. reorder Inventory reorder decision (see :meth:InventoryAgent.reorder). echelon_orders Order series at each echelon (index 0 = store demand). bullwhip_ratio Order-variance amplification from bottom to top echelon. history Diagnostic records.

SupplyChainOrchestrator

Coordinate demand-sensing, inventory, and multi-echelon agents.

Pipeline: build a seasonal baseline from POS history (or accept a foundation-model base_forecast), estimate and apply promotion lift, fuse external signals into sensed demand, derive an inventory reorder decision, and propagate orders up the supply chain.

Parameters

season Seasonal period for the POS baseline forecaster. lead_time Replenishment lead time for the inventory policy. n_echelons Number of upstream echelons to coordinate.

_baseline(pos_history, horizon)

Seasonal-naive POS baseline (mean fallback for short history).

run(pos_history, horizon, signals=None, signal_weights=None, promo_history=None, promo_schedule=None, on_hand=0.0, base_forecast=None)

Run the full demand-sensing and coordination pipeline.

Parameters

pos_history Historical point-of-sale demand. horizon Forecast horizon in steps. signals Optional external signal uplift paths (social, weather, events). signal_weights Optional per-signal fusion weights. promo_history Optional (sales, promo_flags) for lift estimation. promo_schedule Optional future promotion indicator path (length horizon). on_hand Current on-hand inventory. base_forecast Optional externally supplied baseline (e.g. a foundation-model forecast) used instead of the seasonal POS baseline.

Returns

SupplyChainResult

_safe(base_forecast, pos_history) staticmethod

Return a non-empty array for diagnostic means.