4using System.Threading.Tasks;
5using LotSizingDataModel.Core.Relationships;
6using LotSizingDataModel.Instance;
30 LotSizingInstance instance,
33 ArgumentNullException.ThrowIfNull(
36 ArgumentNullException.ThrowIfNull(
40 options.IncludeSafetyStock &&
41 options.IncludeSafetyStockViolation &&
42 instance.SupplyChain.Inventories.Any(
44 inventory.SafetyStock is not
null &&
45 inventory.SafetyStockViolationCost is not
null);
52 LotSizingInstance instance,
55 CancellationToken cancellationToken)
59 in instance.SupplyChain.Inventories)
61 if (inventory.SafetyStock is
null ||
62 inventory.SafetyStockViolationCost is
null)
69 period <= instance.PlanningHorizon;
72 cancellationToken.ThrowIfCancellationRequested();
77 .InventorySafetyStockViolation)
95 $
"VSS_i{inventory.ItemId}_w" +
96 $
"{inventory.Warehouse.ReferenceId}_t{period}",
98 double.PositiveInfinity,
99 $
"Safety-stock violation for item " +
100 $
"{inventory.ItemId} at warehouse " +
101 $
"{inventory.Warehouse.ReferenceId}, " +
102 $
"period {period}.");
106 return ValueTask.CompletedTask;
Builds stable business-domain keys for mathematical variables and constraints.
string Build()
Builds the immutable domain-key text.
MathematicalDomainKeyBuilder Add(string name, string value)
Adds a text segment.
Provides the shared state required while constructing a solver-independent mathematical model.
Creates canonical domain-key fragments shared by standard formulation builders and provides warehouse...
static MathematicalDomainKeyBuilder AddWarehouse(MathematicalDomainKeyBuilder builder, WarehouseReference warehouse)
Adds a warehouse reference using the generic warehouse or plant segment.
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
const string InventorySafetyStockViolation
Identifies safety-stock violation decision variables.
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...
const string Item
Item or product identifier segment.
const string Period
Period index segment.