LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
IMathematicalModelSolver.cs
Go to the documentation of this file.
1using System.Threading;
2using System.Threading.Tasks;
5
7
8/// <summary>
9/// Defines a solver adapter capable of solving an already built,
10/// solver-independent mathematical model.
11/// </summary>
12/// <remarks>
13/// Implementations translate the generic mathematical model
14/// contained in <see cref="MathematicalModelSolveRequest"/> into
15/// the native representation of a specific optimization engine.
16/// They must not rebuild lot-sizing equations from the original
17/// business instance.
18/// </remarks>
20{
21 /// <summary>
22 /// Gets the solver kind.
23 /// </summary>
25 {
26 get;
27 }
28
29 /// <summary>
30 /// Gets the solver name.
31 /// </summary>
33 {
34 get;
35 }
36
37 /// <summary>
38 /// Gets the solver version when available.
39 /// </summary>
41 {
42 get;
43 }
44
45 /// <summary>
46 /// Gets a value indicating whether a solve operation is
47 /// currently running.
48 /// </summary>
50 {
51 get;
52 }
53
54 /// <summary>
55 /// Solves a solver-independent mathematical model.
56 /// </summary>
57 /// <param name="request">
58 /// Mathematical-model solve request.
59 /// </param>
60 /// <param name="cancellationToken">
61 /// Token used to cancel the solve operation.
62 /// </param>
63 /// <returns>
64 /// Task returning the generic mathematical-model solve
65 /// result.
66 /// </returns>
67 /// <exception cref="System.ArgumentNullException">
68 /// Thrown when <paramref name="request"/> is
69 /// <see langword="null"/>.
70 /// </exception>
71 /// <exception cref="System.InvalidOperationException">
72 /// Thrown when the request is invalid or another solve
73 /// operation is already running.
74 /// </exception>
75 ValueTask<MathematicalModelSolveResult> SolveAsync(
77 CancellationToken cancellationToken = default);
78
79 /// <summary>
80 /// Requests interruption of the currently running solve
81 /// operation.
82 /// </summary>
83 /// <remarks>
84 /// The request is cooperative. Native solver adapters should
85 /// forward it to the corresponding solver interruption
86 /// mechanism whenever available.
87 /// </remarks>
89}
Describes a request to solve an already built, solver-independent mathematical model.
Defines a solver adapter capable of solving an already built, solver-independent mathematical model.
void RequestStop()
Requests interruption of the currently running solve operation.
ValueTask< MathematicalModelSolveResult > SolveAsync(MathematicalModelSolveRequest request, CancellationToken cancellationToken=default)
Solves a solver-independent mathematical model.
bool IsRunning
Gets a value indicating whether a solve operation is currently running.
string SolverVersion
Gets the solver version when available.