2using LotSizingDataModel.Core.PhysicalModel;
25 WarehouseReference left,
26 WarehouseReference right)
28 ArgumentNullException.ThrowIfNull(left);
29 ArgumentNullException.ThrowIfNull(right);
32 left.Kind == right.Kind &&
33 left.ReferenceId == right.ReferenceId;
42 WarehouseReference warehouse)
44 ArgumentNullException.ThrowIfNull(builder);
45 ArgumentNullException.ThrowIfNull(warehouse);
47 return warehouse.Kind
switch
49 WarehouseReferenceKind.StandaloneWarehouse =>
52 warehouse.ReferenceId),
54 WarehouseReferenceKind.PlantWarehouse =>
57 warehouse.ReferenceId),
60 throw new InvalidOperationException(
61 $
"Unsupported warehouse-reference kind " +
62 $
"'{warehouse.Kind}'.")
71 WarehouseReference warehouse)
73 ArgumentNullException.ThrowIfNull(builder);
74 ArgumentNullException.ThrowIfNull(warehouse);
76 return warehouse.Kind
switch
78 WarehouseReferenceKind.StandaloneWarehouse =>
81 warehouse.ReferenceId),
83 WarehouseReferenceKind.PlantWarehouse =>
86 warehouse.ReferenceId),
89 throw new InvalidOperationException(
90 $
"Unsupported origin warehouse-reference kind " +
91 $
"'{warehouse.Kind}'.")
100 WarehouseReference warehouse)
102 ArgumentNullException.ThrowIfNull(builder);
103 ArgumentNullException.ThrowIfNull(warehouse);
105 return warehouse.Kind
switch
107 WarehouseReferenceKind.StandaloneWarehouse =>
110 warehouse.ReferenceId),
112 WarehouseReferenceKind.PlantWarehouse =>
115 warehouse.ReferenceId),
118 throw new InvalidOperationException(
119 $
"Unsupported destination warehouse-reference " +
120 $
"kind '{warehouse.Kind}'.")
Builds stable business-domain keys for mathematical variables and constraints.
MathematicalDomainKeyBuilder Add(string name, string value)
Adds a text segment.
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.
static MathematicalDomainKeyBuilder AddDestinationWarehouse(MathematicalDomainKeyBuilder builder, WarehouseReference warehouse)
Adds a destination warehouse reference.
static MathematicalDomainKeyBuilder AddOriginWarehouse(MathematicalDomainKeyBuilder builder, WarehouseReference warehouse)
Adds an origin warehouse reference.
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...
const string Plant
Plant identifier segment.
const string DestinationWarehouse
Standalone destination-warehouse identifier segment.
const string OriginPlant
Origin-plant identifier segment.
const string DestinationPlant
Destination-plant identifier segment.
const string Warehouse
Warehouse identifier segment.
const string OriginWarehouse
Standalone origin-warehouse identifier segment.