18 ArgumentNullException.ThrowIfNull(descriptor);
19 ArgumentNullException.ThrowIfNull(universalNotation);
22 RenderPlanning(descriptor);
25 RenderAlpha(descriptor);
28 RenderBeta(universalNotation);
31 RenderGamma(universalNotation);
33 IReadOnlyDictionary<string, string> dimensions =
34 BuildDimensions(descriptor);
40 pair => pair.Key +
"=" + pair.Value));
57 universalNotation.
Render(),
58 ProjectLegacyProblemFamily(descriptor),
62 private static string RenderPlanning(
66 !descriptor.Demand.HasDemand
68 : descriptor.Demand.IsTimeVarying
73 !descriptor.Demand.HasDemand
75 : descriptor.Demand.IsDeterministic
80 descriptor.Scheduling.BucketMode
switch
82 Core.DecisionModel.Scheduling
83 .SchedulingBucketMode.BigBucket =>
"BB",
84 Core.DecisionModel.Scheduling
85 .SchedulingBucketMode.SmallBucket =>
"SB",
86 Core.DecisionModel.Scheduling
87 .SchedulingBucketMode.MacroMicro =>
"MM",
104 private static string RenderAlpha(
107 string itemCardinality =
108 descriptor.Structure.ItemCount
switch
117 .ProductStructureRelationshipCount > 0
121 string productStructure =
122 descriptor.Structure.ProductStructureType
switch
133 descriptor.SupplyNetwork.ForwardNetwork.Topology
switch
135 SupplyNetworkTopologyType.Independent =>
"IND",
136 SupplyNetworkTopologyType.Serial =>
"SER",
137 SupplyNetworkTopologyType.Convergent =>
"CONV",
138 SupplyNetworkTopologyType.Divergent =>
"DIV",
139 SupplyNetworkTopologyType.Tree =>
"TREE",
140 SupplyNetworkTopologyType.General =>
"GEN",
148 "I=" + itemCardinality,
150 "PS=" + productStructure,
153 (descriptor.Structure.IsMultiSite ?
"MULTI" :
"SINGLE"),
156 .ToString(CultureInfo.InvariantCulture)
160 private static string RenderBeta(
161 UniversalLotSizingNotation notation)
163 var tokens =
new List<string>();
166 in notation.Beta.Features.OrderBy(
167 feature => (
int)feature))
172 if (token is not
null)
174 tokens.Add(token +
"=1");
179 in notation.Beta.TemporalQualifiers.OrderBy(
180 qualifier => (
int)qualifier.Parameter))
183 MapTemporalParameter(
184 qualifier.Parameter);
186 if (parameter is
null)
199 return tokens.Count == 0
201 :
string.Join(
";", tokens);
204 private static string? MapFeature(
207 return feature
switch
209 UniversalNotationFeature.Demand =>
"DEM",
210 UniversalNotationFeature.Production =>
"PROD",
211 UniversalNotationFeature.ProductionCapacity =>
"CAP.P",
212 UniversalNotationFeature.SharedProductionCapacity =>
"CAP.P.SH",
213 UniversalNotationFeature.SupplierCapacity =>
"CAP.S",
214 UniversalNotationFeature.TransportCapacity =>
"CAP.T",
215 UniversalNotationFeature.WarehouseCapacity =>
"CAP.W",
216 UniversalNotationFeature.SetupCost =>
"SET.C",
217 UniversalNotationFeature.SetupTime =>
"SET.T",
218 UniversalNotationFeature.StartUpCost =>
"SET.SU.C",
219 UniversalNotationFeature.StartUpTime =>
"SET.SU.T",
220 UniversalNotationFeature.MinimumLotSize =>
"LOT.MIN",
221 UniversalNotationFeature.MaximumLotSize =>
"LOT.MAX",
222 UniversalNotationFeature.LotSizeMultiple =>
"LOT.MUL",
223 UniversalNotationFeature.ProductionLeadTime =>
"LT.P",
224 UniversalNotationFeature.InitialInventory =>
"INV.I0",
225 UniversalNotationFeature.SafetyStock =>
"INV.SS",
226 UniversalNotationFeature.Backlogging =>
"SHORT.BO",
227 UniversalNotationFeature.LostSales =>
"SHORT.LS",
228 UniversalNotationFeature.Purchasing =>
"SRC.BUY",
229 UniversalNotationFeature.SupplierLeadTime =>
"LT.S",
230 UniversalNotationFeature.Transportation =>
"TRANS",
231 UniversalNotationFeature.TransportLeadTime =>
"LT.T",
232 UniversalNotationFeature.Distribution =>
"DIST",
233 UniversalNotationFeature.FinancialConstraint =>
"FIN",
234 UniversalNotationFeature.IntegratedScheduling =>
"SCH",
235 UniversalNotationFeature.BigBucketScheduling =>
"SCH.BB",
236 UniversalNotationFeature.SmallBucketScheduling =>
"SCH.SB",
237 UniversalNotationFeature.MacroMicroScheduling =>
"SCH.MM",
238 UniversalNotationFeature.InitialSetupState =>
"SET.INIT",
239 UniversalNotationFeature.SetupCarryOver =>
"SET.CO",
240 UniversalNotationFeature.SequenceDependentChangeoverTime =>
242 UniversalNotationFeature.SequenceDependentChangeoverCost =>
244 UniversalNotationFeature.MaximumSetupCount =>
"SCH.MAXSET",
245 UniversalNotationFeature.GroupingConstraint =>
"LOT.GRP",
246 UniversalNotationFeature.ProductionSetupFamily =>
"SET.FAM",
247 UniversalNotationFeature.ProductionSetupFamilyTime =>
"SET.FAM.T",
248 UniversalNotationFeature.AdditionalProductionCapacity =>
250 UniversalNotationFeature.AdditionalWarehouseCapacity =>
252 UniversalNotationFeature.AdditionalTransportCapacity =>
258 private static string? MapTemporalParameter(
261 return parameter
switch
263 UniversalTemporalParameter.Demand =>
"DEM",
264 UniversalTemporalParameter.SetupCost =>
"SET.C",
265 UniversalTemporalParameter.HoldingCost =>
"HOLD.C",
266 UniversalTemporalParameter.ProductionCost =>
"PROD.C",
267 UniversalTemporalParameter.ProductionCapacity =>
"CAP.P",
268 UniversalTemporalParameter.MinimumLotSize =>
"LOT.MIN",
269 UniversalTemporalParameter.StartUpTime =>
"SET.SU.T",
270 UniversalTemporalParameter.MaximumLotSize =>
"LOT.MAX",
271 UniversalTemporalParameter.SupplierCapacity =>
"CAP.S",
276 private static string MapTemporalPattern(
279 return pattern
switch
281 TemporalPatternType.Zero =>
"Z",
282 TemporalPatternType.Constant =>
"C",
283 TemporalPatternType.NonIncreasing =>
"NI",
284 TemporalPatternType.NonDecreasing =>
"ND",
285 TemporalPatternType.General =>
"G",
290 private static string RenderGamma(
291 UniversalLotSizingNotation notation)
294 notation.Gamma.Objective
switch
296 UniversalObjectiveKind.Economic =>
"ECON",
297 UniversalObjectiveKind.MultipleObjectives =>
"MULTI",
298 UniversalObjectiveKind.Financial =>
"FIN",
299 UniversalObjectiveKind.Sustainability =>
"SUST",
300 UniversalObjectiveKind.ServiceLevel =>
"SERVICE",
304 return "S=MIN;AGG=" +
305 (notation.Gamma.Objective ==
306 UniversalObjectiveKind.MultipleObjectives
313 private static IReadOnlyDictionary<string, string>
315 LotSizingProblemDescriptor descriptor)
317 return new Dictionary<string, string>(
318 StringComparer.Ordinal)
321 descriptor.Time.PlanningHorizon
322 .ToString(CultureInfo.InvariantCulture),
324 descriptor.Structure.ItemCount
325 .ToString(CultureInfo.InvariantCulture),
327 descriptor.Structure.PlantCount
328 .ToString(CultureInfo.InvariantCulture),
330 descriptor.Structure.WorkCenterCount
331 .ToString(CultureInfo.InvariantCulture),
333 descriptor.Structure.WarehouseCount
334 .ToString(CultureInfo.InvariantCulture),
336 descriptor.Structure.SupplierCount
337 .ToString(CultureInfo.InvariantCulture),
339 descriptor.Structure.DistributionCenterCount
340 .ToString(CultureInfo.InvariantCulture),
342 descriptor.Structure.TransportResourceCount
343 .ToString(CultureInfo.InvariantCulture),
345 descriptor.Structure.ProductStructureRelationshipCount
346 .ToString(CultureInfo.InvariantCulture),
348 descriptor.Structure.MaximumProductStructureDepth
349 .ToString(CultureInfo.InvariantCulture)
353 private static string ProjectLegacyProblemFamily(
354 LotSizingProblemDescriptor descriptor)
361 .ProductStructureRelationshipCount > 0;
366 return capacitated ?
"LS-C" :
"LS-U";
372 return capacitated ?
"CLSP" :
"LS-U";
378 return capacitated ?
"MLCLSP" :
"MLLP";