LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
LotSizingProblemDescriptor.cs
Go to the documentation of this file.
1using LotSizingDataModel.Core;
2using LotSizingDataModel.Core.DecisionModel.Objectives;
3using LotSizingDataModel.Core.DecisionModel.Scheduling;
6
8
9/// <summary>
10/// Typed structured description of the factual lot-sizing problem
11/// characteristics currently represented by an instance.
12/// </summary>
13/// <remarks>
14/// Alpha.4 is a lossless non-serialized bridge over the historical
15/// LotSizingProblemFeatures vector. The target extraction direction is
16/// Core source data -> typed Descriptor -> legacy Features.
17/// </remarks>
18public sealed class LotSizingProblemDescriptor
19{
20 public StructureDescriptor Structure { get; init; } = new();
21 public TimeDescriptor Time { get; init; } = new();
22 public DemandDescriptor Demand { get; init; } = new();
23 public ProductionDescriptor Production { get; init; } = new();
24 public CapacityDescriptor Capacity { get; init; } = new();
25 public SetupDescriptor Setup { get; init; } = new();
26 public InventoryServiceDescriptor InventoryService { get; init; } = new();
27 public ProcurementDescriptor Procurement { get; init; } = new();
29 public ObjectiveFinanceDescriptor ObjectiveFinance { get; init; } = new();
30 public SchedulingDescriptor Scheduling { get; init; } = new();
31
32 /// <summary>Gets the physical supply-flow network descriptor.</summary>
33 public SupplyNetworkDescriptor SupplyNetwork { get; private set; } = new();
34
35 /// <summary>
36 /// Gets the production-capacity regime derived from existing production
37 /// and production-capacity facts.
38 /// </summary>
40 !Production.HasProduction
42 : !Capacity.HasProductionCapacity
44 : Capacity.HasTimeVaryingProductionCapacity
46 : ProductionCapacityRegime.Constant;
47
50 {
51 ArgumentNullException.ThrowIfNull(features);
52
54 {
56 {
57 ItemCount = features.ItemCount,
58 PlantCount = features.PlantCount,
59 WorkCenterCount = features.WorkCenterCount,
60 WarehouseCount = features.WarehouseCount,
61 SupplierCount = features.SupplierCount,
62 DistributionCenterCount = features.DistributionCenterCount,
63 TransportResourceCount = features.TransportResourceCount,
64 ProductStructureRelationshipCount = features.ProductStructureRelationshipCount,
65 MaximumProductStructureDepth = features.MaximumProductStructureDepth,
66 ProductStructureType = features.ProductStructureType,
67 IsMultiSite = features.IsMultiSite
68 },
70 {
71 PlanningHorizon = features.PlanningHorizon
72 },
74 {
75 HasDemand = features.HasDemand,
76 IsDeterministic = features.HasDeterministicDemand,
77 IsTimeVarying = features.HasTimeVaryingDemand
78 },
80 {
81 HasProduction = features.HasProduction,
82 HasLeadTimes = features.HasProductionLeadTimes,
83 HasMinimumLotSizes = features.HasMinimumLotSizes,
84 HasMaximumLotSizes = features.HasMaximumLotSizes,
85 HasLotSizeMultiples = features.HasLotSizeMultiples,
86 HasGroupingConstraints = features.HasGroupingConstraints
87 },
89 {
90 HasProductionCapacity = features.HasProductionCapacityConstraints,
91 HasSharedProductionCapacity = features.HasSharedProductionCapacity,
92 HasTimeVaryingProductionCapacity = features.HasTimeVaryingProductionCapacity,
93 HasSupplierCapacity = features.HasSupplierCapacityConstraints,
94 HasTransportCapacity = features.HasTransportCapacityConstraints,
95 HasWarehouseCapacity = features.HasWarehouseCapacityConstraints,
96 HasAdditionalProductionCapacity = features.HasAdditionalProductionCapacity,
97 HasAdditionalWarehouseCapacity = features.HasAdditionalWarehouseCapacity,
98 HasAdditionalTransportCapacity = features.HasAdditionalTransportCapacity
99 },
101 {
102 HasSetupCosts = features.HasSetupCosts,
103 HasSetupTimes = features.HasSetupTimes,
104 HasStartUpCosts = features.HasStartUpCosts,
105 HasStartUpTimes = features.HasStartUpTimes,
106 HasProductionSetupFamilies =
108 HasProductionSetupFamilyTimes =
109 features.HasProductionSetupFamilyTimes
110 },
112 {
113 HasInitialInventory = features.HasInitialInventory,
114 HasSafetyStockRequirements = features.HasSafetyStockRequirements,
115 HasBacklogging = features.HasBacklogging,
116 HasLostSales = features.HasLostSales
117 },
119 {
120 HasPurchasing = features.HasPurchasing,
121 HasSupplierLeadTimes = features.HasSupplierLeadTimes
122 },
124 {
125 HasTransportation = features.HasTransportation,
126 HasTransportLeadTimes = features.HasTransportLeadTimes,
127 HasDistribution = features.HasDistribution
128 },
130 {
131 HasFinancialConstraints = features.HasFinancialConstraints,
132 HasMultipleObjectives = features.HasMultipleObjectives,
133 ObjectiveCriterionCount = features.ObjectiveCriterionCount,
134 PrimaryObjectiveKind = features.PrimaryObjectiveKind,
135 AggregationMode = features.ObjectiveAggregationMode
136 },
138 {
139 HasIntegratedScheduling = features.HasIntegratedScheduling,
140 BucketMode = features.SchedulingBucketMode,
141 SmallBucketProductionMode =
143 SchedulingResourceCount =
145 MicroPeriodLengthMode =
146 features.MicroPeriodLengthMode,
147 MicroPeriodAssignmentMode =
149 HasExplicitMicroPeriodGrid =
151 TotalMicroPeriodCount =
152 features.TotalMicroPeriodCount,
153 MaximumMicroPeriodCountPerMacroPeriod =
155 HasVariableMicroPeriodCount =
157 HasMaximumProducedItemCountConstraint =
159 MaximumProducedItemCountPerBucket =
161 MaximumSetupTransitionsPerBucket =
163 HasInitialSetupState = features.HasInitialSetupState,
164 HasSetupCarryOver = features.HasSetupCarryOver,
165 SetupCarryOverPolicy = features.SetupCarryOverPolicy,
166 HasSequenceDependentChangeoverTimes =
168 HasSequenceDependentChangeoverCosts =
170 HasMaximumSetupCountConstraints =
171 features.HasMaximumSetupCountConstraints
172 }
173 };
174 }
175
176 /// <summary>
177 /// Creates the typed descriptor and enriches it with physical-network
178 /// analysis derived directly from Core data.
179 /// </summary>
182 SupplyChain supplyChain)
183 {
184 ArgumentNullException.ThrowIfNull(supplyChain);
185
186 LotSizingProblemDescriptor descriptor =
187 FromLegacyFeatures(features);
188
189 descriptor.SupplyNetwork =
190 new SupplyNetworkAnalyzer().Analyze(supplyChain);
191
192 return descriptor;
193 }
194
196 {
197 return new LotSizingProblemFeatures
198 {
199 ItemCount = Structure.ItemCount,
200 PlanningHorizon = Time.PlanningHorizon,
201 PlantCount = Structure.PlantCount,
202 WorkCenterCount = Structure.WorkCenterCount,
203 WarehouseCount = Structure.WarehouseCount,
204 SupplierCount = Structure.SupplierCount,
205 DistributionCenterCount = Structure.DistributionCenterCount,
206 TransportResourceCount = Structure.TransportResourceCount,
207 ProductStructureRelationshipCount = Structure.ProductStructureRelationshipCount,
208 MaximumProductStructureDepth = Structure.MaximumProductStructureDepth,
209 ProductStructureType = Structure.ProductStructureType,
210
211 HasDemand = Demand.HasDemand,
212 HasDeterministicDemand = Demand.IsDeterministic,
213 HasTimeVaryingDemand = Demand.IsTimeVarying,
214
215 HasInitialInventory = InventoryService.HasInitialInventory,
216 HasSafetyStockRequirements = InventoryService.HasSafetyStockRequirements,
217 HasBacklogging = InventoryService.HasBacklogging,
218 HasLostSales = InventoryService.HasLostSales,
219
220 HasProduction = Production.HasProduction,
221 HasProductionCapacityConstraints = Capacity.HasProductionCapacity,
222 HasSharedProductionCapacity = Capacity.HasSharedProductionCapacity,
223 HasTimeVaryingProductionCapacity = Capacity.HasTimeVaryingProductionCapacity,
224
225 HasSetupCosts = Setup.HasSetupCosts,
226 HasSetupTimes = Setup.HasSetupTimes,
227 HasStartUpCosts = Setup.HasStartUpCosts,
228 HasStartUpTimes = Setup.HasStartUpTimes,
229 HasProductionSetupFamilies =
230 Setup.HasProductionSetupFamilies,
231 HasProductionSetupFamilyTimes =
232 Setup.HasProductionSetupFamilyTimes,
233
234 HasProductionLeadTimes = Production.HasLeadTimes,
235 HasMinimumLotSizes = Production.HasMinimumLotSizes,
236 HasMaximumLotSizes = Production.HasMaximumLotSizes,
237 HasLotSizeMultiples = Production.HasLotSizeMultiples,
238 HasGroupingConstraints = Production.HasGroupingConstraints,
239
240 HasAdditionalProductionCapacity = Capacity.HasAdditionalProductionCapacity,
241 HasAdditionalWarehouseCapacity = Capacity.HasAdditionalWarehouseCapacity,
242 HasAdditionalTransportCapacity = Capacity.HasAdditionalTransportCapacity,
243
244 HasPurchasing = Procurement.HasPurchasing,
245 HasSupplierCapacityConstraints = Capacity.HasSupplierCapacity,
246 HasSupplierLeadTimes = Procurement.HasSupplierLeadTimes,
247
248 HasTransportation = TransportationDistribution.HasTransportation,
249 HasTransportCapacityConstraints = Capacity.HasTransportCapacity,
250 HasTransportLeadTimes = TransportationDistribution.HasTransportLeadTimes,
251
252 HasDistribution = TransportationDistribution.HasDistribution,
253 HasWarehouseCapacityConstraints = Capacity.HasWarehouseCapacity,
254
255 IsMultiSite = Structure.IsMultiSite,
256 HasFinancialConstraints = ObjectiveFinance.HasFinancialConstraints,
257 HasMultipleObjectives = ObjectiveFinance.HasMultipleObjectives,
258 ObjectiveCriterionCount = ObjectiveFinance.ObjectiveCriterionCount,
259 PrimaryObjectiveKind = ObjectiveFinance.PrimaryObjectiveKind,
260 ObjectiveAggregationMode = ObjectiveFinance.AggregationMode,
261
262 HasIntegratedScheduling = Scheduling.HasIntegratedScheduling,
263 SchedulingBucketMode = Scheduling.BucketMode,
264 SmallBucketProductionMode =
265 Scheduling.SmallBucketProductionMode,
266 SchedulingResourceCount =
267 Scheduling.SchedulingResourceCount,
268 MicroPeriodLengthMode =
269 Scheduling.MicroPeriodLengthMode,
270 MicroPeriodAssignmentMode =
271 Scheduling.MicroPeriodAssignmentMode,
272 HasExplicitMicroPeriodGrid =
273 Scheduling.HasExplicitMicroPeriodGrid,
274 TotalMicroPeriodCount =
275 Scheduling.TotalMicroPeriodCount,
276 MaximumMicroPeriodCountPerMacroPeriod =
277 Scheduling.MaximumMicroPeriodCountPerMacroPeriod,
278 HasVariableMicroPeriodCount =
279 Scheduling.HasVariableMicroPeriodCount,
280 HasMaximumProducedItemCountConstraint =
281 Scheduling.HasMaximumProducedItemCountConstraint,
282 MaximumProducedItemCountPerBucket =
283 Scheduling.MaximumProducedItemCountPerBucket,
284 MaximumSetupTransitionsPerBucket =
285 Scheduling.MaximumSetupTransitionsPerBucket,
286 HasInitialSetupState = Scheduling.HasInitialSetupState,
287 HasSetupCarryOver = Scheduling.HasSetupCarryOver,
288 SetupCarryOverPolicy = Scheduling.SetupCarryOverPolicy,
289 HasSequenceDependentChangeoverTimes =
290 Scheduling.HasSequenceDependentChangeoverTimes,
291 HasSequenceDependentChangeoverCosts =
292 Scheduling.HasSequenceDependentChangeoverCosts,
293 HasMaximumSetupCountConstraints =
294 Scheduling.HasMaximumSetupCountConstraints
295 };
296 }
297}
Describes the factual structural and modeling features detected in a lot-sizing supply-chain instance...
bool HasDemand
Gets or sets a value indicating whether the instance contains demand data.
bool HasMultipleObjectives
Gets or sets a value indicating whether several objective criteria are represented.
bool HasFinancialConstraints
Gets or sets a value indicating whether explicit financial constraints are represented.
bool HasProductionLeadTimes
Gets or sets a value indicating whether production lead times are represented.
bool HasBacklogging
Gets or sets a value indicating whether unmet demand may be carried to later periods.
bool HasTransportCapacityConstraints
Gets or sets a value indicating whether transportation is subject to capacity constraints.
bool HasTransportation
Gets or sets a value indicating whether transportation decisions are represented.
bool HasSupplierCapacityConstraints
Gets or sets a value indicating whether suppliers are subject to capacity constraints.
int ItemCount
Gets or sets the number of items in the instance.
bool HasMaximumLotSizes
Gets or sets a value indicating whether at least one explicit maximum lot size is imposed.
bool HasMinimumLotSizes
Gets or sets a value indicating whether at least one positive minimum lot size is imposed.
int DistributionCenterCount
Gets or sets the number of distribution centers.
bool HasStartUpCosts
Gets or sets a value indicating whether the model contains start-up costs distinct from setup costs.
bool HasLotSizeMultiples
Gets or sets a value indicating whether at least one lot size must be an integer multiple of a base s...
bool HasStartUpTimes
Gets or sets a value indicating whether the model contains start-up times distinct from setup times.
bool HasInitialInventory
Gets or sets a value indicating whether at least one positive initial-inventory value exists.
bool HasProduction
Gets or sets a value indicating whether the instance contains production decisions.
bool HasSetupTimes
Gets or sets a value indicating whether setups consume production-resource capacity.
bool HasWarehouseCapacityConstraints
Gets or sets a value indicating whether storage is subject to warehouse-capacity constraints.
bool HasSetupCosts
Gets or sets a value indicating whether at least one setup or fixed production cost exists.
int TransportResourceCount
Gets or sets the number of transport resources.
ProductStructureType ProductStructureType
Gets or sets the detected product-structure category.
bool HasAdditionalProductionCapacity
Gets or sets a value indicating whether additional production capacity can be acquired or activated.
bool HasSharedProductionCapacity
Gets or sets a value indicating whether several production activities share at least one capacity.
int WorkCenterCount
Gets or sets the total number of work centers.
int ProductStructureRelationshipCount
Gets or sets the number of distinct bill-of-materials relationships.
int ObjectiveCriterionCount
Gets or sets the number of enabled objective criteria.
bool HasAdditionalWarehouseCapacity
Gets or sets a value indicating whether additional warehouse capacity can be acquired or activated.
bool HasProductionCapacityConstraints
Gets or sets a value indicating whether production is subject to capacity constraints.
bool HasTimeVaryingProductionCapacity
Gets or sets a value indicating whether at least one production capacity varies between periods.
bool HasSafetyStockRequirements
Gets or sets a value indicating whether the instance contains safety-stock requirements.
bool HasDeterministicDemand
Gets or sets a value indicating whether demand is deterministic.
bool HasPurchasing
Gets or sets a value indicating whether external purchasing decisions are represented.
bool HasTransportLeadTimes
Gets or sets a value indicating whether transport lead times are represented.
int MaximumProductStructureDepth
Gets or sets the maximum number of bill-of-materials relationships on a directed product-structure pa...
Describes represented capacity families and extensions.
Describes demand semantics already represented by the model.
Typed structured description of the factual lot-sizing problem characteristics currently represented ...
ProductionCapacityRegime ProductionCapacityRegime
Gets the production-capacity regime derived from existing production and production-capacity facts.
SupplyNetworkDescriptor SupplyNetwork
Gets the physical supply-flow network descriptor.
static LotSizingProblemDescriptor FromLegacyFeatures(LotSizingProblemFeatures features, SupplyChain supplyChain)
Creates the typed descriptor and enriches it with physical-network analysis derived directly from Cor...
static LotSizingProblemDescriptor FromLegacyFeatures(LotSizingProblemFeatures features)
Extracts the physical forward supply-flow graph encoded by Core.
Describes the physical supply-flow network independently from the BOM and independently from any plan...
Describes procurement semantics represented by the current model.
Factual integrated lot-sizing/scheduling characteristics.
Describes setup semantics exposed by the current model.
Describes structural dimensions of a lot-sizing problem.