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


Namespace:  Microsoft.SolverFoundation.Services
Assembly:  Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)


Public NotInheritable Class SolverContext
public sealed class SolverContext
public ref class SolverContext sealed
type SolverContext =  class end
public final class SolverContext

The SolverContext type exposes the following members.


  Name Description
Public method SolverContext Construct a solver service context.



  Name Description
Public property CurrentModel Gets the model that is currently loaded in the context.
Public property DataSource Gets or sets the database context for data.
Public property RegisteredSolvers Get all registered plug-in solvers.
Public property SamplingParameters Gets the parameters for random sampling.



  Name Description
Public method CheckModel Checks a model for errors.
Public method ClearModel Clears a model.
Public method CreateModel Creates a model.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method FindAllowedValues(IEnumerable<DecisionBinding>) Finds all allowed values for a set of decisions.
Public method FindAllowedValues(IEnumerable<DecisionBinding>, Func<TResult>, Void) Finds all allowed values for a set of decisions.
Public methodStatic member GetContext Returns the singleton context.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method LoadModel(ILinearModel) Loads a linear model.
Public method LoadModel(ITermModel) Loads a non-linear model.
Public method LoadModel(FileFormat, TextReader) Loads a model from a file.
Public method LoadModel(FileFormat, String) Loads a model in OML, MPS, or .SMPS format.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method PropagateDecisions Writes decision values from the current solution back to the database.
Public method SaveModel Writes the decision values from a solution.
Public method Solve() Solves a model that has been created and loaded.
Public method Solve(array<Directive[]) Solves a model that has been created and loaded. Solves the model using the specified directives.
Public method Solve(Func<TResult>, Void) Solves a model that has been created and loaded.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)



  Name Description
Public event DataBinding Occurs when data is bound to a solver.
Public event Solving Occurs when a solver is solving a model.



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.

See Also


Microsoft.SolverFoundation.Services Namespace