LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
ScientificSolverBackendDefinition.cs
Go to the documentation of this file.
2
4
5/// <summary>
6/// One technical optimization backend. A backend is not a scientific solution
7/// method.
8/// </summary>
10{
12 SolverKind solverKind,
13 string name,
14 IEnumerable<ScientificSolutionMethodCategory>
15 supportedMethodCategories)
16 {
17 if (
18 solverKind is
19 SolverKind.Unknown or
20 SolverKind.Automatic)
21 {
22 throw new ArgumentOutOfRangeException(
23 nameof(solverKind),
24 solverKind,
25 "A backend definition requires a concrete solver kind.");
26 }
27
28 if (string.IsNullOrWhiteSpace(name))
29 {
30 throw new ArgumentException(
31 "A backend name is required.",
32 nameof(name));
33 }
34
35 ArgumentNullException.ThrowIfNull(supportedMethodCategories);
36
37 SolverKind = solverKind;
38 Name = name.Trim();
39
41 supportedMethodCategories
42 .Distinct()
43 .OrderBy(value => (int)value)
44 .ToArray();
45 }
46
47 public SolverKind SolverKind { get; }
48 public string Name { get; }
49
50 public IReadOnlyList<ScientificSolutionMethodCategory>
52
53 public bool Supports(
56 method.Category);
57}
ScientificSolverBackendDefinition(SolverKind solverKind, string name, IEnumerable< ScientificSolutionMethodCategory > supportedMethodCategories)