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();
75 foreach (Inventory inventory
76 in instance.SupplyChain.Inventories)
85 var inventoryKeyBuilder =
104 context.GetVariable(inventoryKey),
105 inventory.UnitCapacityConsumption?[period] ??
109 inventory.SetupTime?[period] ??
114 var setupKeyBuilder =
123 inventory.Warehouse);
132 if (context.VariableRegistry.TryGet(
135 setupVariable is not
null)
144 var additionalKeyBuilder =
147 .WarehouseAdditionalCapacity);
150 additionalKeyBuilder,
153 string additionalKey =
160 if (context.VariableRegistry.TryGet(
163 additionalVariable is not
null)
171 $
"warehouseCapacity_w{entry.Reference.ReferenceId}" +
175 entry.Warehouse.CapacityConstraint[period],
177 "Global warehouse capacity constraint.");
181 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.