2using System.Collections.Generic;
3using System.Xml.Serialization;
4using LotSizingDataModel.Solution;
20[XmlType(TypeName =
"solverRunResult")]
23 private readonly List<string> _diagnostics =
26 private readonly List<SolverProgressSnapshot>
36 Guid.NewGuid().ToString(
"D");
60 [XmlAttribute(
"runId")]
70 [XmlElement(
"runName")]
80 [XmlAttribute(
"solverKind")]
90 [XmlElement(
"solverName")]
100 [XmlElement(
"solverVersion")]
110 [XmlElement(
"formulationName")]
121 [XmlElement(
"startedAtUtc")]
132 [XmlElement(
"completedAtUtc")]
142 [XmlElement(
"elapsedSeconds")]
153 [XmlElement(
"processorSeconds")]
163 [XmlAttribute(
"terminationReason")]
173 [XmlElement(
"objectiveValue")]
184 [XmlElement(
"recomputedObjectiveValue")]
195 [XmlElement(
"objectiveDifference")]
205 [XmlAttribute(
"objectiveVerificationStatus")]
215 [XmlElement(
"bestBound")]
225 [XmlElement(
"absoluteGap")]
235 [XmlElement(
"relativeGap")]
245 [XmlElement(
"exploredNodeCount")]
255 [XmlElement(
"iterationCount")]
265 [XmlElement(
"solutionCount")]
276 [XmlElement(
"solution")]
286 [XmlArray(
"progressHistory")]
287 [XmlArrayItem(
"point")]
295 [XmlArray(
"diagnostics")]
296 [XmlArrayItem(
"diagnostic")]
333 if (
string.IsNullOrWhiteSpace(
336 throw new ArgumentException(
337 "A diagnostic message cannot be empty.",
352 IEnumerable<SolverProgressSnapshot> snapshots)
354 ArgumentNullException.ThrowIfNull(
357 _progressHistory.Clear();
363 ArgumentNullException.ThrowIfNull(
366 _progressHistory.Add(
List< SolverProgressSnapshot > ProgressHistory
Gets the retained convergence history.
int SolutionCount
Gets or sets the number of feasible solutions found.
SolverRunResult()
Initializes an empty solver run result.
LotSizingSolution? Solution
Gets or sets the normalized lot-sizing solution created from the native solver result.
string SolverVersion
Gets or sets the solver version.
double? ProcessorSeconds
Gets or sets the elapsed processor time in seconds, when available.
DateTime StartedAtUtc
Gets or sets the UTC date and time at which the run started.
double? AbsoluteGap
Gets or sets the final absolute optimality gap.
double? RelativeGap
Gets or sets the final relative optimality gap.
void SetProgressHistory(IEnumerable< SolverProgressSnapshot > snapshots)
Copies retained progress snapshots into the result.
double? ObjectiveValue
Gets or sets the final incumbent objective value.
bool IsSuccessful
Gets a value indicating whether the solver run completed without an execution failure.
void AddDiagnostic(string message)
Adds a diagnostic message.
List< string > Diagnostics
Gets the diagnostics produced during model generation, solver execution, and solution extraction.
string RunId
Gets or sets the unique solver-run identifier.
SolverTerminationReason TerminationReason
Gets or sets the normalized termination reason.
string SolverName
Gets or sets the solver display name.
double? BestBound
Gets or sets the final best objective bound.
string FormulationName
Gets or sets the mathematical formulation name.
bool HasSolution
Gets a value indicating whether a normalized solution is available.
double? RecomputedObjectiveValue
Gets or sets the objective value independently recomputed from the normalized decision-variable value...
double? ObjectiveDifference
Gets or sets the absolute difference between the solver-reported and recomputed objective values.
double ElapsedSeconds
Gets or sets the elapsed wall-clock time in seconds.
DateTime? CompletedAtUtc
Gets or sets the UTC date and time at which the run completed.
SolverKind SolverKind
Gets or sets the solver kind used for the run.
long? IterationCount
Gets or sets the number of solver iterations.
long? ExploredNodeCount
Gets or sets the number of explored search-tree nodes.
string RunName
Gets or sets the user-defined solver-run name.
ObjectiveVerificationStatus ObjectiveVerificationStatus
Gets or sets the result of objective-value verification.
Represents an immutable snapshot of the current progress of a mathematical optimization run.
SolverTerminationReason
Describes why a solver execution terminated.
@ RelativeGapLimit
The configured relative optimality-gap limit was reached.
@ TimeLimit
The configured time limit was reached.
@ Feasible
A feasible solution was found, but optimality was not proven.
@ SolutionLimit
The configured solution limit was reached.
@ NodeLimit
The configured node limit was reached.
@ Optimal
An optimal solution was proven.
@ IterationLimit
The configured iteration limit was reached.