ULSAlgorithms 1.1.0-g3e5595996d
High-performance exact and heuristic algorithms for uncapacitated lot sizing
Loading...
Searching...
No Matches
CutRecord.cs
Go to the documentation of this file.
2
3/// <summary>
4/// Trace record for one generated cutting-plane constraint.
5/// </summary>
6public sealed class CutRecord
7{
8 /// <summary>Initializes one cut trace record.</summary>
9 public CutRecord(
10 int sequenceNumber,
11 int iteration,
12 CutSeparationMethod separationMethod,
13 LsCutDefinition definition,
14 double violation,
15 double efficacy,
16 CutDisposition disposition,
17 string solverConstraintName = "",
18 string dispositionReason = "")
19 {
20 if (sequenceNumber < 0)
21 {
22 throw new ArgumentOutOfRangeException(nameof(sequenceNumber));
23 }
24
25 if (iteration < 0)
26 {
27 throw new ArgumentOutOfRangeException(nameof(iteration));
28 }
29
30 if (separationMethod == CutSeparationMethod.Unknown)
31 {
32 throw new ArgumentOutOfRangeException(nameof(separationMethod));
33 }
34
35 ArgumentNullException.ThrowIfNull(definition);
36
37 if (!double.IsFinite(violation))
38 {
39 throw new ArgumentOutOfRangeException(nameof(violation));
40 }
41
42 if (!double.IsFinite(efficacy))
43 {
44 throw new ArgumentOutOfRangeException(nameof(efficacy));
45 }
46
47 SequenceNumber = sequenceNumber;
48 Iteration = iteration;
49 Family = CutFamily.Ls;
50 SeparationMethod = separationMethod;
51 Definition = definition;
52 Violation = violation;
53 Efficacy = efficacy;
54 Disposition = disposition;
55 SolverConstraintName = solverConstraintName ?? string.Empty;
56 DispositionReason = dispositionReason ?? string.Empty;
57 }
58
59 /// <summary>Gets the stable sequence number within the solve.</summary>
60 public int SequenceNumber { get; }
61
62 /// <summary>Gets the cutting-plane iteration that generated this cut.</summary>
63 public int Iteration { get; }
64
65 /// <summary>Gets the cut family.</summary>
66 public CutFamily Family { get; }
67
68 /// <summary>Gets the separation method.</summary>
70
71 /// <summary>Gets the complete solver-independent (l,S) definition.</summary>
73
74 /// <summary>Gets the violation measured when the cut was generated.</summary>
75 public double Violation { get; }
76
77 /// <summary>Gets the cut efficacy metric used by the separator.</summary>
78 public double Efficacy { get; }
79
80 /// <summary>Gets the final disposition of this generated cut.</summary>
82
83 /// <summary>Gets whether the constraint was actually added to the solver model.</summary>
84 public bool WasAdded => Disposition == CutDisposition.Added;
85
86 /// <summary>Gets the row/constraint name used by the selected solver adapter.</summary>
87 public string SolverConstraintName { get; }
88
89 /// <summary>Gets a human-readable explanation of the disposition.</summary>
90 public string DispositionReason { get; }
91}
int SequenceNumber
Gets the stable sequence number within the solve.
Definition CutRecord.cs:60
CutFamily Family
Gets the cut family.
Definition CutRecord.cs:66
double Violation
Gets the violation measured when the cut was generated.
Definition CutRecord.cs:75
LsCutDefinition Definition
Gets the complete solver-independent (l,S) definition.
Definition CutRecord.cs:72
string SolverConstraintName
Gets the row/constraint name used by the selected solver adapter.
Definition CutRecord.cs:87
CutDisposition Disposition
Gets the final disposition of this generated cut.
Definition CutRecord.cs:81
double Efficacy
Gets the cut efficacy metric used by the separator.
Definition CutRecord.cs:78
bool WasAdded
Gets whether the constraint was actually added to the solver model.
Definition CutRecord.cs:84
int Iteration
Gets the cutting-plane iteration that generated this cut.
Definition CutRecord.cs:63
CutSeparationMethod SeparationMethod
Gets the separation method.
Definition CutRecord.cs:69
CutRecord(int sequenceNumber, int iteration, CutSeparationMethod separationMethod, LsCutDefinition definition, double violation, double efficacy, CutDisposition disposition, string solverConstraintName="", string dispositionReason="")
Initializes one cut trace record.
Definition CutRecord.cs:9
string DispositionReason
Gets a human-readable explanation of the disposition.
Definition CutRecord.cs:90
Solver-independent definition of one ULS (l,S) inequality.
CutSeparationMethod
Identifies the separation procedure that generated a cut.
CutDisposition
Describes what happened to a generated cut after separation.
CutFamily
Identifies a family of valid inequalities generated by a separator.
Definition CutFamily.cs:5