3using System.Threading.Tasks;
4using LotSizingDataModel.Core.PhysicalModel;
5using LotSizingDataModel.Core.Relationships;
6using LotSizingDataModel.Instance;
31 LotSizingInstance instance,
34 ArgumentNullException.ThrowIfNull(instance);
35 ArgumentNullException.ThrowIfNull(options);
38 .EnumerateWarehouses(instance.SupplyChain))
40 if (entry.Warehouse.CapacityConstraint is not
null)
53 LotSizingInstance instance,
56 CancellationToken cancellationToken)
59 .EnumerateWarehouses(instance.SupplyChain))
61 if (entry.Warehouse.CapacityConstraint is
null)
67 period <= instance.PlanningHorizon;
70 cancellationToken.ThrowIfCancellationRequested();
72 if (entry.Warehouse.GetStorageCapacity(period) is not
double maximum)
78 foreach (Inventory inventory
79 in instance.SupplyChain.Inventories)
88 var inventoryKeyBuilder =
107 context.GetVariable(inventoryKey),
108 inventory.UnitCapacityConsumption?[period] ??
112 inventory.SetupTime?[period] ??
117 var setupKeyBuilder =
126 inventory.Warehouse);
135 if (context.VariableRegistry.TryGet(
138 setupVariable is not
null)
147 var additionalKeyBuilder =
150 .WarehouseAdditionalCapacity);
153 additionalKeyBuilder,
156 string additionalKey =
163 if (context.VariableRegistry.TryGet(
166 additionalVariable is not
null)
174 $
"warehouseCapacity_w{entry.Reference.ReferenceId}" +
180 "Global warehouse capacity constraint.");
184 return ValueTask.CompletedTask;
Provides a fluent builder for linear expressions.
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 bool AreSameWarehouse(WarehouseReference left, WarehouseReference right)
Determines whether two warehouse references identify the same physical 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 Inventory
Identifies inventory-level decision variables.
const string InventorySetup
Identifies inventory setup 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.
Represents one decision variable in a mathematical optimization model.
MathematicalConstraintSense
Identifies the relational sense of a mathematical constraint.