1using LotSizingDataModel.Instance;
2using LotSizingDataModel.Instance.Results;
3using LotSizingDataModel.Solution;
15public sealed class SolutionVerificationBatchCandidate
17 private SolutionVerificationBatchCandidate(
19 string? candidateName,
20 LotSizingInstance instance,
21 LotSizingSolution? solution,
26 ValidateCandidateKey(candidateKey);
29 string.IsNullOrWhiteSpace(candidateName)
35 throw new ArgumentNullException(nameof(instance));
108 LotSizingInstance instance,
109 LotSizingSolution solution,
110 string? candidateName =
null)
112 ArgumentNullException.ThrowIfNull(solution);
114 return new SolutionVerificationBatchCandidate(
136 LotSizingInstance instance,
138 string? candidateName =
null)
140 ArgumentNullException.ThrowIfNull(knownResult);
142 if (knownResult.DetailedSolution is
null)
144 throw new InvalidOperationException(
145 "The known result does not contain a detailed solution " +
146 "that can be independently checked.");
149 return new SolutionVerificationBatchCandidate(
158 private static string ValidateCandidateKey(
161 if (
string.IsNullOrWhiteSpace(candidateKey))
163 throw new ArgumentException(
164 "The candidate key cannot be empty.",
165 nameof(candidateKey));
SolutionVerificationBatchCandidateKind Kind
Gets the candidate representation kind.
LotSizingInstance Instance
Gets the lot-sizing instance against which the candidate is checked.
KnownResult? KnownResult
Gets the known result when Kind is SolutionVerificationBatchCandidateKind.KnownResult.
static SolutionVerificationBatchCandidate ForKnownResult(string candidateKey, LotSizingInstance instance, KnownResult knownResult, string? candidateName=null)
Creates a candidate from a known result containing a detailed solution.
LotSizingSolution? Solution
Gets the standalone solution when Kind is SolutionVerificationBatchCandidateKind.StandaloneSolution.
static SolutionVerificationBatchCandidate ForSolution(string candidateKey, LotSizingInstance instance, LotSizingSolution solution, string? candidateName=null)
Creates a candidate from a standalone solution.
string CandidateKey
Gets the stable caller-defined identifier used to correlate results with the input candidate.
string? CandidateName
Gets an optional human-readable candidate name.
SolutionVerificationBatchCandidateKind
Identifies the domain object represented by a batch-verification candidate.