LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
DebConstraintGaBridgeResult.cs
Go to the documentation of this file.
2
3public sealed class DebConstraintGaBridgeResult
4{
6 string algorithmId,
7 IReadOnlyList<double> rawSearchPoint,
8 IReadOnlyList<double> modelVariableValues,
9 double objectiveValue,
10 double totalConstraintViolation,
11 bool isFeasible,
12 int evaluations,
13 int iterations,
14 ulong seed,
15 TimeSpan duration)
16 {
17 ArgumentNullException.ThrowIfNull(
18 rawSearchPoint);
19
20 ArgumentNullException.ThrowIfNull(
21 modelVariableValues);
22
24 algorithmId?.Trim() ??
25 string.Empty;
26
28 rawSearchPoint.ToArray();
29
31 modelVariableValues.ToArray();
32
34 objectiveValue;
35
37 totalConstraintViolation;
38
40 isFeasible;
41
43 evaluations;
44
46 iterations;
47
48 Seed =
49 seed;
50
51 Duration =
52 duration;
53
55 }
56
57 public string AlgorithmId
58 {
59 get;
60 }
61
62 public double[] RawSearchPoint
63 {
64 get;
65 }
66
67 public double[] ModelVariableValues
68 {
69 get;
70 }
71
72 public double ObjectiveValue
73 {
74 get;
75 }
76
78 {
79 get;
80 }
81
82 public bool IsFeasible
83 {
84 get;
85 }
86
87 public int Evaluations
88 {
89 get;
90 }
91
92 public int Iterations
93 {
94 get;
95 }
96
97 public ulong Seed
98 {
99 get;
100 }
101
102 public TimeSpan Duration
103 {
104 get;
105 }
106
107 public void EnsureValid()
108 {
109 if (string.IsNullOrWhiteSpace(
111 {
112 throw new InvalidOperationException(
113 "A metaheuristic algorithm identifier is required.");
114 }
115
116 if (!double.IsFinite(
118 !double.IsFinite(
121 {
122 throw new InvalidOperationException(
123 "Metaheuristic objective and violation values must be finite and valid.");
124 }
125
126 if (RawSearchPoint.Length == 0 ||
127 ModelVariableValues.Length == 0)
128 {
129 throw new InvalidOperationException(
130 "Metaheuristic result vectors cannot be empty.");
131 }
132
133 if (Evaluations <= 0 ||
134 Iterations < 0 ||
135 Duration < TimeSpan.Zero)
136 {
137 throw new InvalidOperationException(
138 "Metaheuristic execution statistics are invalid.");
139 }
140 }
141}
DebConstraintGaBridgeResult(string algorithmId, IReadOnlyList< double > rawSearchPoint, IReadOnlyList< double > modelVariableValues, double objectiveValue, double totalConstraintViolation, bool isFeasible, int evaluations, int iterations, ulong seed, TimeSpan duration)