LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
LotSizingProblemClassDetector.cs
Go to the documentation of this file.
2
4
5/// <summary>
6/// Detects all executable canonical problem classes compatible with one
7/// descriptor.
8/// </summary>
10{
11 private readonly LotSizingProblemClassAnalyzer _analyzer;
12
17
20 {
21 _analyzer =
22 analyzer ??
23 throw new ArgumentNullException(nameof(analyzer));
24 }
25
26 public IReadOnlyList<LotSizingProblemClassMatchResult> Detect(
28 {
29 ArgumentNullException.ThrowIfNull(descriptor);
30
31 IReadOnlyList<LotSizingProblemClassDefinition>
32 candidateDefinitions =
33 descriptor.Scheduling.HasIntegratedScheduling
36
37 return candidateDefinitions
38 .Select(
39 definition =>
40 _analyzer.Assess(
41 descriptor,
42 definition))
43 .Where(result => result.IsMember)
44 .OrderBy(
45 result =>
46 result.Kind ==
48 ? 0
49 : 1)
50 .ThenBy(
51 result =>
52 result.Definition.Code,
53 StringComparer.Ordinal)
54 .ToArray();
55 }
56
59 {
60 IReadOnlyList<LotSizingProblemClassMatchResult> matches =
61 Detect(descriptor);
62
63 return matches.Count == 1
64 ? matches[0]
65 : null;
66 }
67}
Typed structured description of the factual lot-sizing problem characteristics currently represented ...
Assesses one descriptor against one canonical problem-class core.
static IReadOnlyList< LotSizingProblemClassDefinition > SchedulingDetectableClasses
static IReadOnlyList< LotSizingProblemClassDefinition > ExecutableClasses
IReadOnlyList< LotSizingProblemClassMatchResult > Detect(LotSizingProblemDescriptor descriptor)
LotSizingProblemClassMatchResult? DetectSingle(LotSizingProblemDescriptor descriptor)
LotSizingProblemClassMatchKind
Relationship between an instance descriptor and one canonical problem class.