LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
WolseyMachineClassification.cs
Go to the documentation of this file.
2
3/// <summary>Bucket-size subfield in Wolsey's multi-item extension.</summary>
4public enum WolseyBucketType
5{
9}
10
11/// <summary>
12/// Capacity-utilization/setup/changeover markers in Wolsey's multi-item
13/// extension.
14/// </summary>
22
23/// <summary>
24/// Preserves the IM/VM machine-mode labels used in Wolsey's formal scheme.
25/// </summary>
26/// <remarks>
27/// The historical symbols are preserved without expanding or reinterpreting
28/// them here. Their exact wording is kept as source terminology until the
29/// project has a verified primary-source definition suitable for semantic
30/// mapping.
31/// </remarks>
33{
36}
37
38/// <summary>
39/// Typed representation of the machine block
40/// {NK=#,[IM,VM],[LT]*,[SB1,SB2,BB],[SET,ST,SQT,SQC]*}.
41/// </summary>
42public sealed class WolseyMachineClassification
43{
45 int machineCount,
46 WolseyMachineMode machineMode,
47 WolseyBucketType bucketType,
48 bool hasLeadTimes = false,
49 IEnumerable<WolseyMachineFeature>? features = null)
50 {
51 if (machineCount <= 0)
52 {
53 throw new ArgumentOutOfRangeException(
54 nameof(machineCount),
55 machineCount,
56 "Wolsey NK must be strictly positive.");
57 }
58
59 MachineCount = machineCount;
60 MachineMode = machineMode;
61 BucketType = bucketType;
62 HasLeadTimes = hasLeadTimes;
63
64 Features =
65 (features ?? Array.Empty<WolseyMachineFeature>())
66 .Distinct()
67 .OrderBy(feature => (int)feature)
68 .ToArray();
69 }
70
71 public int MachineCount { get; }
73 public bool HasLeadTimes { get; }
75 public IReadOnlyCollection<WolseyMachineFeature> Features { get; }
76
77 public string HistoricalCode
78 {
79 get
80 {
81 var parts =
82 new List<string>
83 {
84 $"NK={MachineCount}",
85 MachineMode.ToString()
86 };
87
88 if (HasLeadTimes)
89 {
90 parts.Add("LT");
91 }
92
93 parts.Add(BucketType.ToString());
94
95 parts.AddRange(
96 Features.Select(feature => feature.ToString()));
97
98 return
99 "{" +
100 string.Join(",", parts) +
101 "}";
102 }
103 }
104
105 public override string ToString() =>
107}
WolseyMachineClassification(int machineCount, WolseyMachineMode machineMode, WolseyBucketType bucketType, bool hasLeadTimes=false, IEnumerable< WolseyMachineFeature >? features=null)
WolseyMachineFeature
Capacity-utilization/setup/changeover markers in Wolsey's multi-item extension.
WolseyMachineMode
Preserves the IM/VM machine-mode labels used in Wolsey's formal scheme.
WolseyBucketType
Bucket-size subfield in Wolsey's multi-item extension.