LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
LotSizingProblemClassDefinition.cs
Go to the documentation of this file.
3
5
6/// <summary>
7/// One canonical scientific problem-class definition.
8/// </summary>
10{
13 string code,
14 string name,
16 IEnumerable<string>? aliases = null,
17 UniversalProblemSpecification? universalCoreSpecification = null,
18 IEnumerable<string>? capabilityGaps = null,
19 string? scientificNote = null)
20 {
21 if (string.IsNullOrWhiteSpace(code))
22 {
23 throw new ArgumentException(
24 "A canonical problem-class code is required.",
25 nameof(code));
26 }
27
28 if (string.IsNullOrWhiteSpace(name))
29 {
30 throw new ArgumentException(
31 "A canonical problem-class name is required.",
32 nameof(name));
33 }
34
35 if (
36 supportLevel ==
38 universalCoreSpecification is null)
39 {
40 throw new ArgumentException(
41 "Executable problem classes require a universal core " +
42 "specification.",
43 nameof(universalCoreSpecification));
44 }
45
46 Id = id;
47 Code = code.Trim();
48 Name = name.Trim();
49 SupportLevel = supportLevel;
50 UniversalCoreSpecification = universalCoreSpecification;
51 ScientificNote = scientificNote;
52
53 Aliases =
54 (aliases ?? Array.Empty<string>())
55 .Where(alias => !string.IsNullOrWhiteSpace(alias))
56 .Select(alias => alias.Trim())
57 .Distinct(StringComparer.OrdinalIgnoreCase)
58 .OrderBy(alias => alias, StringComparer.OrdinalIgnoreCase)
59 .ToArray();
60
62 (capabilityGaps ?? Array.Empty<string>())
63 .Where(gap => !string.IsNullOrWhiteSpace(gap))
64 .Select(gap => gap.Trim())
65 .Distinct(StringComparer.Ordinal)
66 .OrderBy(gap => gap, StringComparer.Ordinal)
67 .ToArray();
68
69 Concept =
71 Code,
72 Name,
73 ScientificConceptCategory.LotSizingProblemClass);
74 }
75
77 public string Code { get; }
78 public string Name { get; }
80 public IReadOnlyList<string> Aliases { get; }
82 public IReadOnlyList<string> CapabilityGaps { get; }
83 public string? ScientificNote { get; }
85
86 public override string ToString() =>
87 $"{Code} — {Name}";
88}
Represents a universal notation interpreted as a problem specification.
LotSizingProblemClassDefinition(CanonicalLotSizingProblemClassId id, string code, string name, LotSizingProblemClassSupportLevel supportLevel, IEnumerable< string >? aliases=null, UniversalProblemSpecification? universalCoreSpecification=null, IEnumerable< string >? capabilityGaps=null, string? scientificNote=null)
Identifies one named scientific concept together with its taxonomic category.
LotSizingProblemClassSupportLevel
Implementation support of one scientifically catalogued problem class.
CanonicalLotSizingProblemClassId
Stable canonical LotSizingDataModel identifiers for problem classes.
ScientificConceptCategory
Distinguishes scientific concept categories that must not be conflated when describing a lot-sizing i...