LotSizingDataModel.Checker
2.0.1
Reusable validation engine for structural, mathematical and objective consistency checks.
Loading...
Searching...
No Matches
SolutionVerificationBatchOptions.cs
Go to the documentation of this file.
1
using
LotSizingDataModel.Checker.Configuration
;
2
3
namespace
LotSizingDataModel.Checker.Batch
;
4
5
/// <summary>
6
/// Configures execution of a batch solution-verification campaign.
7
/// </summary>
8
public
sealed
class
SolutionVerificationBatchOptions
9
{
10
/// <summary>
11
/// Gets or sets the maximum number of candidates verified concurrently.
12
/// </summary>
13
/// <remarks>
14
/// The default is bounded to four workers to avoid excessive memory use
15
/// while mathematical models are built for several candidates at once.
16
/// </remarks>
17
public
int
MaxDegreeOfParallelism
18
{
19
get
;
20
set
;
21
} = Math.Max(
22
1,
23
Math.Min(
24
Environment.ProcessorCount,
25
4));
26
27
/// <summary>
28
/// Gets or sets the verification policy applied independently to every
29
/// candidate.
30
/// </summary>
31
public
SolutionVerificationOptions
VerificationOptions
32
{
33
get
;
34
set
;
35
} =
new
();
36
37
/// <summary>
38
/// Validates this batch configuration.
39
/// </summary>
40
public
void
EnsureValid
()
41
{
42
if
(
MaxDegreeOfParallelism
< 1)
43
{
44
throw
new
ArgumentOutOfRangeException(
45
nameof(
MaxDegreeOfParallelism
),
46
MaxDegreeOfParallelism
,
47
"The maximum degree of parallelism must be at least one."
);
48
}
49
50
if
(
VerificationOptions
is
null
)
51
{
52
throw
new
InvalidOperationException(
53
"VerificationOptions cannot be null."
);
54
}
55
56
VerificationOptions
.EnsureValid();
57
}
58
}
LotSizingDataModel.Checker.Batch.SolutionVerificationBatchOptions
Configures execution of a batch solution-verification campaign.
Definition
SolutionVerificationBatchOptions.cs:9
LotSizingDataModel.Checker.Batch.SolutionVerificationBatchOptions.VerificationOptions
SolutionVerificationOptions VerificationOptions
Gets or sets the verification policy applied independently to every candidate.
Definition
SolutionVerificationBatchOptions.cs:32
LotSizingDataModel.Checker.Batch.SolutionVerificationBatchOptions.MaxDegreeOfParallelism
int MaxDegreeOfParallelism
Gets or sets the maximum number of candidates verified concurrently.
Definition
SolutionVerificationBatchOptions.cs:18
LotSizingDataModel.Checker.Batch.SolutionVerificationBatchOptions.EnsureValid
void EnsureValid()
Validates this batch configuration.
Definition
SolutionVerificationBatchOptions.cs:40
LotSizingDataModel.Checker.Configuration.SolutionVerificationOptions
Configures the high-level verification facade and the application of checker results back to domain o...
Definition
SolutionVerificationOptions.cs:8
LotSizingDataModel.Checker.Batch
Definition
LotSizingSolutionBatchVerificationService.cs:5
LotSizingDataModel.Checker.Configuration
Definition
SolutionCheckOptions.cs:3
LotSizingDataModel.Checker
Batch
SolutionVerificationBatchOptions.cs
Generated by
1.17.0