SolverContext Class

Solver Foundation 3.0

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Provides services to solvers.


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

public ref class SolverContext sealed

The SolverContext type exposes the following members.

Public methodSolverContext Construct a solver service context.

Public propertyCurrentModelGets the model that is currently loaded in the context.
Public propertyDataSourceGets or sets the database context for data.
Public propertyRegisteredSolversGet all registered plug-in solvers.
Public propertySamplingParametersGets the parameters for random sampling.

Public methodCheckModelChecks a model for errors.
Public methodClearModelClears a model.
Public methodCreateModelCreates a model.
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodFindAllowedValues(IEnumerable<DecisionBinding>)Finds all allowed values for a set of decisions.
Public methodFindAllowedValues(IEnumerable<DecisionBinding>, Func<TResult>, Void)Finds all allowed values for a set of decisions.
Public methodStatic memberGetContextReturns the singleton context.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodLoadModel(ILinearModel)Loads a linear model.
Public methodLoadModel(ITermModel)Loads a non-linear model.
Public methodLoadModel(FileFormat, TextReader)Loads a model from a file.
Public methodLoadModel(FileFormat, String)Loads a model in OML, MPS, or .SMPS format.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodPropagateDecisionsWrites decision values from the current solution back to the database.
Public methodSaveModelWrites the decision values from a solution.
Public methodSolve()Solves a model that has been created and loaded.
Public methodSolve(array<Directive>)Solves a model that has been created and loaded. Solves the model using the specified directives.
Public methodSolve(Func<TResult>, Void)Solves a model that has been created and loaded.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Public eventDataBindingOccurs when data is bound to a solver.
Public eventSolvingOccurs 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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.