LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
ILotSizingSolver.cs
Go to the documentation of this file.
1using System;
2using System.Threading;
3using System.Threading.Tasks;
7
9
10/// <summary>
11/// Defines the common contract implemented by every
12/// lot-sizing solver adapter.
13/// </summary>
14/// <remarks>
15/// Implementations adapt a native optimization engine such as
16/// CPLEX, Gurobi, FICO Xpress, or COIN-OR CBC to the common
17/// solver model.
18/// </remarks>
19public interface ILotSizingSolver
20{
21 /// <summary>
22 /// Occurs when new progress information is available.
23 /// </summary>
24 event EventHandler<SolverProgressEventArgs>?
26
27 /// <summary>
28 /// Gets the solver kind implemented by this adapter.
29 /// </summary>
31 {
32 get;
33 }
34
35 /// <summary>
36 /// Gets the display name of the solver.
37 /// </summary>
39 {
40 get;
41 }
42
43 /// <summary>
44 /// Gets the detected solver version.
45 /// </summary>
47 {
48 get;
49 }
50
51 /// <summary>
52 /// Gets a value indicating whether a solve operation is
53 /// currently running.
54 /// </summary>
56 {
57 get;
58 }
59
60 /// <summary>
61 /// Checks whether the solver is installed, loadable, and
62 /// licensed when a license is required.
63 /// </summary>
64 /// <param name="cancellationToken">
65 /// Token used to cancel the availability check.
66 /// </param>
67 /// <returns>
68 /// Availability and installation information.
69 /// </returns>
70 ValueTask<SolverAvailabilityInfo> CheckAvailabilityAsync(
71 CancellationToken cancellationToken = default);
72
73 /// <summary>
74 /// Solves a lot-sizing instance.
75 /// </summary>
76 /// <param name="request">
77 /// Solver request.
78 /// </param>
79 /// <param name="cancellationToken">
80 /// Token used to interrupt model generation or solver
81 /// execution.
82 /// </param>
83 /// <returns>
84 /// Normalized solver execution result.
85 /// </returns>
86 /// <exception cref="ArgumentNullException">
87 /// Thrown when <paramref name="request"/> is
88 /// <see langword="null"/>.
89 /// </exception>
90 /// <exception cref="InvalidOperationException">
91 /// Thrown when a second solve operation is requested while
92 /// the solver is already running.
93 /// </exception>
94 Task<SolverRunResult> SolveAsync(
95 SolverRequest request,
96 CancellationToken cancellationToken = default);
97
98 /// <summary>
99 /// Requests interruption of the current solver execution.
100 /// </summary>
101 /// <remarks>
102 /// The request is cooperative. The native solver adapter
103 /// should forward it to the underlying solver as quickly as
104 /// its callback or interruption API permits.
105 /// </remarks>
107}
Describes a request to solve a lot-sizing instance.
Defines the common contract implemented by every lot-sizing solver adapter.
Task< SolverRunResult > SolveAsync(SolverRequest request, CancellationToken cancellationToken=default)
Solves a lot-sizing instance.
void RequestStop()
Requests interruption of the current solver execution.
string SolverVersion
Gets the detected solver version.
bool IsRunning
Gets a value indicating whether a solve operation is currently running.
ValueTask< SolverAvailabilityInfo > CheckAvailabilityAsync(CancellationToken cancellationToken=default)
Checks whether the solver is installed, loadable, and licensed when a license is required.
string SolverName
Gets the display name of the solver.
EventHandler< SolverProgressEventArgs >? ProgressChanged
Occurs when new progress information is available.
SolverKind SolverKind
Gets the solver kind implemented by this adapter.