3using System.Threading.Tasks;
4using LotSizingDataModel.Core.Relationships;
5using LotSizingDataModel.Instance;
23 LotSizingInstance instance,
26 ArgumentNullException.ThrowIfNull(instance);
27 ArgumentNullException.ThrowIfNull(options);
35 .EnumerateWarehouses(instance.SupplyChain))
37 if (entry.Warehouse.FixedUsageCost is not
null &&
38 entry.Warehouse.CapacityConstraint is not
null)
49 LotSizingInstance instance,
52 CancellationToken cancellationToken)
55 .EnumerateWarehouses(instance.SupplyChain))
57 if (entry.Warehouse.FixedUsageCost is
null ||
58 entry.Warehouse.CapacityConstraint is
null)
63 for (
int period = 1; period <= instance.PlanningHorizon; period++)
65 cancellationToken.ThrowIfCancellationRequested();
69 foreach (Inventory inventory
in instance.SupplyChain.Inventories)
86 inventory.UnitCapacityConsumption?[period] ?? 1.0);
89 var activationKeyBuilder =
97 string activationKey =
103 context.GetVariable(activationKey),
104 entry.Warehouse.CapacityConstraint[period]);
108 $
"warehouseActivationLink_w" +
109 $
"{entry.Reference.ReferenceId}_t{period}",
114 "Warehouse inventory load requires activation.");
118 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 WarehouseActivation
Identifies warehouse activation decision variables.
const string Inventory
Identifies inventory-level decision variables.
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...
const string Period
Period index segment.
MathematicalConstraintSense
Identifies the relational sense of a mathematical constraint.