LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
BenchmarkKnownResultAuditService.cs
Go to the documentation of this file.
3
5
6/// <summary>
7/// Audits native KnownResult metadata for benchmark/BKS use.
8/// No parallel verification-status enum is introduced.
9/// </summary>
11{
13 KnownResult result,
14 bool allowReproduced = false,
15 bool requireSourceEvidence = true)
16 {
17 ArgumentNullException.ThrowIfNull(
18 result);
19
20 var diagnostics =
21 new List<string>();
22
23 bool hasObjective =
24 result.ReportedObjectiveValue.HasValue &&
25 double.IsFinite(
26 result.ReportedObjectiveValue.Value);
27
28 if (!hasObjective)
29 {
30 diagnostics.Add(
31 "BKS-NO-OBJECTIVE");
32 }
33
34 bool hasSourceEvidence =
35 !string.IsNullOrWhiteSpace(
36 result.SourceTitle) ||
37 !string.IsNullOrWhiteSpace(
38 result.SourceReference) ||
39 !string.IsNullOrWhiteSpace(
40 result.SourceUri) ||
41 !string.IsNullOrWhiteSpace(
43
44 if (!hasSourceEvidence)
45 {
46 diagnostics.Add(
47 "BKS-NO-SOURCE");
48 }
49
50 bool verificationEligible =
51 result.VerificationStatus is
54 (
55 allowReproduced &&
56 result.VerificationStatus ==
58 );
59
60 if (result.VerificationStatus ==
62 {
63 diagnostics.Add(
64 "BKS-DISPUTED");
65 }
66
67 if (result.VerificationStatus ==
69 {
70 diagnostics.Add(
71 "BKS-INVALIDATED");
72 }
73
74 if (!verificationEligible)
75 {
76 diagnostics.Add(
77 "BKS-VERIFICATION-INELIGIBLE");
78 }
79
80 bool sourceEligible =
81 !requireSourceEvidence ||
82 hasSourceEvidence;
83
84 bool eligible =
85 hasObjective &&
86 verificationEligible &&
87 sourceEligible;
88
90 result.ResultId,
91 result.VerificationStatus,
92 hasObjective,
93 hasSourceEvidence,
94 eligible,
95 diagnostics);
96 }
97}
Audits native KnownResult metadata for benchmark/BKS use. No parallel verification-status enum is int...
BenchmarkKnownResultAuditRecord Audit(KnownResult result, bool allowReproduced=false, bool requireSourceEvidence=true)
Represents a known result associated with a lot-sizing problem instance.
string SourceUri
Gets or sets an optional URI identifying the source from which the result was obtained.
string ResultId
Gets or sets the stable identifier of this result.
KnownResultVerificationStatus VerificationStatus
Gets or sets the level of verification applied to this result.
string SourceTitle
Gets or sets the title of the publication, report, repository or other source reporting the result.
string DigitalObjectIdentifier
Gets or sets the digital object identifier of the publication reporting the result.
double? ReportedObjectiveValue
Gets or sets the objective value explicitly reported for this result.
string SourceReference
Gets or sets a bibliographic or documentary reference for the source reporting the result.
KnownResultVerificationStatus
Indicates the level of verification associated with a known result for a lot-sizing problem instance.
@ IndependentlyVerified
The result has been independently verified using a separate implementation, method or verification pr...
@ Reproduced
The result has been reproduced by executing the reported method or an equivalent implementation.
@ AutomaticallyVerified
The result has been checked automatically against the current supply-chain instance.