2using System.Collections.Generic;
3using System.Xml.Serialization;
13[XmlType(TypeName =
"mathematicalModelBuildResult")]
16 private readonly List<string> _diagnostics =
40 [XmlAttribute(
"requestedFormulationId")]
50 [XmlAttribute(
"selectedFormulationId")]
60 [XmlAttribute(
"selectedFormulationName")]
71 [XmlAttribute(
"isSuccessful")]
82 [XmlAttribute(
"usedFallback")]
103 [XmlAttribute(
"buildDurationMilliseconds")]
111 TimeSpan.FromMilliseconds(
118 [XmlElement(
"failureMessage")]
129 [XmlArray(
"diagnostics")]
130 [XmlArrayItem(
"diagnostic")]
137 [XmlElement(
"model")]
153 if (!
string.IsNullOrWhiteSpace(
172 IEnumerable<string> diagnostics)
174 ArgumentNullException.ThrowIfNull(
204 TimeSpan buildDuration)
206 ArgumentNullException.ThrowIfNull(
209 ArgumentNullException.ThrowIfNull(
237 result.AddDiagnostics(
260 string failureMessage,
261 TimeSpan buildDuration)
289 failureMessage?.Trim() ??
293 if (selection is not
null)
295 result.AddDiagnostics(
299 result.AddDiagnostic(
Represents a solver-independent mathematical optimization model.