SolverContext Class
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Provides services to solvers.
Inheritance Hierarchy
System.Object
Microsoft.SolverFoundation.Services.SolverContext
Namespace: Microsoft.SolverFoundation.Services
Assembly: Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)
Syntax
'Declaration
Public NotInheritable Class SolverContext
public sealed class SolverContext
public ref class SolverContext sealed
[<Sealed>]
type SolverContext = class end
public final class SolverContext
The SolverContext type exposes the following members.
Constructors
Name | Description | |
---|---|---|
SolverContext | Construct a solver service context. |
Top
Properties
Name | Description | |
---|---|---|
CurrentModel | Gets the model that is currently loaded in the context. | |
DataSource | Gets or sets the database context for data. | |
RegisteredSolvers | Get all registered plug-in solvers. | |
SamplingParameters | Gets the parameters for random sampling. |
Top
Methods
Name | Description | |
---|---|---|
CheckModel | Checks a model for errors. | |
ClearModel | Clears a model. | |
CreateModel | Creates a model. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FindAllowedValues(IEnumerable<DecisionBinding>) | Finds all allowed values for a set of decisions. | |
FindAllowedValues(IEnumerable<DecisionBinding>, Func<TResult>, Void) | Finds all allowed values for a set of decisions. | |
GetContext | Returns the singleton context. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
LoadModel(ILinearModel) | Loads a linear model. | |
LoadModel(ITermModel) | Loads a non-linear model. | |
LoadModel(FileFormat, TextReader) | Loads a model from a file. | |
LoadModel(FileFormat, String) | Loads a model in OML, MPS, or .SMPS format. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
PropagateDecisions | Writes decision values from the current solution back to the database. | |
SaveModel | Writes the decision values from a solution. | |
Solve() | Solves a model that has been created and loaded. | |
Solve(array<Directive[]) | Solves a model that has been created and loaded. Solves the model using the specified directives. | |
Solve(Func<TResult>, Void) | Solves a model that has been created and loaded. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Events
Name | Description | |
---|---|---|
DataBinding | Occurs when data is bound to a solver. | |
Solving | Occurs when a solver is solving a model. |
Top
Remarks
SolverContext is the first class that a Solver Foundation Services (SFS) developer should use to create, load, save, and solve models. A SolverContext object works on one model at a time, and an instance of SolverContext is obtained through the static GetContext method.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.