LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
ScientificFormulationDiagnostic.cs
Go to the documentation of this file.
2
3/// <summary>
4/// Stable structured formulation-capability diagnostic.
5/// </summary>
7{
9 string code,
11 string path,
12 string message)
13 {
14 if (string.IsNullOrWhiteSpace(code))
15 {
16 throw new ArgumentException(
17 "A formulation diagnostic code is required.",
18 nameof(code));
19 }
20
21 ArgumentNullException.ThrowIfNull(path);
22 ArgumentNullException.ThrowIfNull(message);
23
24 Code = code.Trim();
25 Severity = severity;
26 Path = path;
27 Message = message;
28 }
29
30 public string Code { get; }
32 public string Path { get; }
33 public string Message { get; }
34
35 public bool IsError =>
37
38 public override string ToString() =>
39 $"[{Severity}] {Code} at {Path}: {Message}";
40}
ScientificFormulationDiagnostic(string code, ScientificFormulationDiagnosticSeverity severity, string path, string message)