ULSAlgorithms 1.1.0-g3e5595996d
High-performance exact and heuristic algorithms for uncapacitated lot sizing
Loading...
Searching...
No Matches
SolverSelectionResult.cs
Go to the documentation of this file.
2
3/// <summary>
4/// Describes the outcome of optimization-solver selection.
5/// </summary>
6public sealed class SolverSelectionResult
7{
8 private readonly string[] _diagnostics;
9
11 SolverKind requestedSolver,
12 IOptimizationSolverAdapter? selectedAdapter,
13 SolverAvailabilityInfo? availability,
14 IEnumerable<string> diagnostics)
15 {
16 RequestedSolver = requestedSolver;
17 SelectedAdapter = selectedAdapter;
18 Availability = availability;
19 _diagnostics = diagnostics.ToArray();
20 }
21
22 /// <summary>Gets the solver requested by the caller.</summary>
24
25 /// <summary>Gets the selected adapter, or null when selection failed.</summary>
27
28 /// <summary>Gets the selected solver kind, or Unknown when none was selected.</summary>
30 SelectedAdapter?.SolverKind ?? SolverKind.Unknown;
31
32 /// <summary>Gets machine-availability information for the selected solver.</summary>
34
35 /// <summary>Gets deterministic selection diagnostics.</summary>
36 public IReadOnlyList<string> Diagnostics => _diagnostics;
37
38 /// <summary>Gets whether a usable adapter was selected.</summary>
39 public bool IsSelected =>
40 SelectedAdapter is not null &&
41 Availability is not null &&
42 Availability.IsUsable;
43}
Describes solver availability and the installation selected by an adapter.
SolverSelectionResult(SolverKind requestedSolver, IOptimizationSolverAdapter? selectedAdapter, SolverAvailabilityInfo? availability, IEnumerable< string > diagnostics)
IReadOnlyList< string > Diagnostics
Gets deterministic selection diagnostics.
SolverKind RequestedSolver
Gets the solver requested by the caller.
bool IsSelected
Gets whether a usable adapter was selected.
IOptimizationSolverAdapter? SelectedAdapter
Gets the selected adapter, or null when selection failed.
SolverKind SelectedSolver
Gets the selected solver kind, or Unknown when none was selected.
SolverAvailabilityInfo? Availability
Gets machine-availability information for the selected solver.
Defines the common metadata and availability contract implemented by every optimization-solver adapte...
SolverKind
Identifies a mathematical optimization solver that can be used by solver-backed ULS algorithms.
Definition SolverKind.cs:15