LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
WolseyHistoricalDescriptor.cs
Go to the documentation of this file.
2
4
6{
8 DLSI = 1,
9 DLS = 2
10}
11
13{
15 U = 1,
16 CC = 2,
17 C = 3
18}
19
21{
23 SB1 = 1,
24 SB2 = 2,
25 BB = 3
26}
27
28/// <summary>
29/// Lossless detected/source-preserved Wolsey descriptor.
30/// </summary>
31public sealed class WolseyHistoricalDescriptor
32{
34
36
38
39 public int NumberOfMachines { get; init; }
40
41 public int NumberOfItems { get; init; }
42
43 public int NumberOfPeriods { get; init; }
44
45 public int? NumberOfLevels { get; init; }
46
47 public bool HasSalesOption { get; init; }
48
49 public bool HasSetupTimes { get; init; }
50
52
53 /// <summary>
54 /// Always false in alpha.32: IM/VM are never inferred.
55 /// </summary>
56 public bool MachineLabelWasInferred => false;
57
58 public bool HasExactCounters =>
59 NumberOfMachines >= 0 &&
60 NumberOfItems >= 0 &&
61 NumberOfPeriods >= 0 &&
62 NumberOfLevels is >= 1;
63
66
67 public string ToDetectedSummary()
68 {
69 var parts = new List<string>();
70
72 {
73 parts.Add(ProblemVariant.ToString());
74 }
75
77 {
78 parts.Add(CapacityVariant.ToString());
79 }
80
81 var variants = new List<string>();
82
84 {
85 variants.Add("SL");
86 }
87
88 if (HasSetupTimes)
89 {
90 variants.Add("SET");
91 }
92
93 string basic =
94 parts.Count == 0
95 ? "Undetermined"
96 : string.Join("-", parts);
97
98 if (variants.Count > 0)
99 {
100 basic += "-{" + string.Join(",", variants) + "}";
101 }
102
103 string counts =
104 $"NK={NumberOfMachines};NI={NumberOfItems};NT={NumberOfPeriods};" +
105 $"NL={(NumberOfLevels?.ToString() ?? "?")}";
106
107 string bucket =
109 ? string.Empty
110 : ";" + BucketVariant;
111
112 return basic + ";" + counts + bucket;
113 }
114}
WolseyDeclaredMachineLabel
Wolsey machine labels preserved from the source without semantic inference.