11 private static readonly
string[] PinnedIds =
13 "chiu-modified-least-unit-cost",
14 "chiu-ting-modified-part-period-balancing",
17 "ho-chang-solis-improved-net-least-period-cost",
18 "ho-chang-solis-net-least-period-cost",
19 "karni-maximum-part-period-gain",
22 "mclaren-order-moment",
23 "part-period-balancing",
24 "part-period-simplified",
25 "patterson-laforge-incremental-part-period",
26 "periodic-order-quantity",
27 "segerstedt-reformulated-silver-meal",
29 "wemmerlov-modified-ppb",
30 "wemmerlov-modified-ppb-lalb",
37 public static IReadOnlyList<UlsSolverDescriptor>
40 UlsSolverDescriptor[] actual =
41 UlsSolverCatalog.Heuristics
45 StringComparer.Ordinal)
55 if (!actualIds.SequenceEqual(
57 StringComparer.Ordinal))
59 throw new InvalidOperationException(
60 "The ULSAlgorithms v1.1.0 heuristic catalog does not match the alpha.35 pinned inventory.");
63 foreach (UlsSolverDescriptor descriptor
66 EnsureHeuristicDescriptor(
76 if (
string.IsNullOrWhiteSpace(
79 throw new ArgumentException(
80 "A ULSAlgorithms heuristic solver ID is required.",
87 if (!PinnedIds.Contains(
89 StringComparer.Ordinal))
91 throw new ArgumentOutOfRangeException(
94 "The requested method is not one of the alpha.35 pinned ULSAlgorithms heuristics.");
97 UlsSolverDescriptor descriptor =
101 EnsureHeuristicDescriptor(
107 private static void EnsureHeuristicDescriptor(
108 UlsSolverDescriptor descriptor)
110 if (descriptor.Kind !=
111 UlsSolverKind.Heuristic ||
112 descriptor.Category !=
113 UlsSolverCategory.Heuristic)
115 throw new InvalidOperationException(
116 $
"ULSAlgorithms solver '{descriptor.Id}' is not classified as a heuristic.");
119 if (descriptor.RequiresExternalSolver)
121 throw new InvalidOperationException(
122 $
"Pinned heuristic '{descriptor.Id}' unexpectedly requires an external optimization solver.");