LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
IMathematicalModelSolverExecutionService.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.Threading;
3using System.Threading.Tasks;
6
8
9/// <summary>
10/// Defines a service that selects a compatible solver adapter
11/// and executes an already built solver-independent
12/// mathematical model.
13/// </summary>
15{
16 /// <summary>
17 /// Selects a solver adapter and solves the mathematical
18 /// model.
19 /// </summary>
20 /// <param name="request">
21 /// Mathematical-model solve request.
22 /// </param>
23 /// <param name="requestedSolver">
24 /// Solver requested by the caller.
25 /// </param>
26 /// <param name="registry">
27 /// Registry containing loaded solver adapters.
28 /// </param>
29 /// <param name="availabilityInformation">
30 /// Availability information associated with detected
31 /// solvers.
32 /// </param>
33 /// <param name="selectionOptions">
34 /// Solver-selection options.
35 /// </param>
36 /// <param name="cancellationToken">
37 /// Token used to cancel solver selection and execution.
38 /// </param>
39 /// <returns>
40 /// Task returning the generic mathematical-model solve
41 /// result.
42 /// </returns>
43 /// <exception cref="System.ArgumentNullException">
44 /// Thrown when one of the required arguments is
45 /// <see langword="null"/>.
46 /// </exception>
47 ValueTask<MathematicalModelSolveResult> SolveAsync(
49 SolverKind requestedSolver,
50 SolverAdapterRegistry registry,
51 IEnumerable<SolverAvailabilityInfo>
52 availabilityInformation,
53 SolverSelectionOptions selectionOptions,
54 CancellationToken cancellationToken = default);
55
56 /// <summary>
57 /// Requests interruption of the mathematical-model solve
58 /// currently executed by the selected solver adapter.
59 /// </summary>
60 /// <remarks>
61 /// Calling this method when no solver adapter is currently
62 /// running has no effect. The selected adapter remains
63 /// responsible for translating this request to its native
64 /// solver API.
65 /// </remarks>
67}
Stores solver adapters that were loaded successfully and provides lookup services by adapter identifi...
Configures how a solver adapter is selected when automatic solver selection is requested.
Describes a request to solve an already built, solver-independent mathematical model.
Defines a service that selects a compatible solver adapter and executes an already built solver-indep...
void RequestStop()
Requests interruption of the mathematical-model solve currently executed by the selected solver adapt...
ValueTask< MathematicalModelSolveResult > SolveAsync(MathematicalModelSolveRequest request, SolverKind requestedSolver, SolverAdapterRegistry registry, IEnumerable< SolverAvailabilityInfo > availabilityInformation, SolverSelectionOptions selectionOptions, CancellationToken cancellationToken=default)
Selects a solver adapter and solves the mathematical model.
SolverKind
Identifies a supported mathematical optimization solver.
Definition SolverKind.cs:12