Model Class

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

Defines a model that has expressions and constraints.

Inheritance Hierarchy

System.Object
  Microsoft.SolverFoundation.Services.Model

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

Syntax

'Declaration
Public NotInheritable Class Model
public sealed class Model
public ref class Model sealed
[<Sealed>]
type Model =  class end
public final class Model

The Model type exposes the following members.

Properties

  Name Description
Public property Constraints Gets a collection of constraints that are defined directly in a model.
Public property Decisions Gets a collection of decisions that are defined directly in a model.
Public property Goals Gets a collection of goals that are defined directly in a model.
Public property IsEmpty Gets a value that indicates whether a model has no decisions, parameters, constraints, or goals.
Public property Name Gets or sets the name of a model.
Public property Parameters Gets all parameters that are defined in a model.
Public property RandomParameters Gets all random parameters that are defined in a model.
Public property RecourseDecisions Gets all recourse decisions that are defined in a model.
Public property SubmodelInstances Gets all instantiations of submodels created directly in a model.
Public property Submodels Gets all submodels created directly in a model.
Public property Tuples Gets all tuples that are defined in a model.

Top

Methods

  Name Description
Public methodStatic member Abs Computes the absolute value of a decision, formula, goal, or constraint.
Public method AddConstraint(String, Term) Adds a constraint to the model..
Public method AddConstraint(String, String) Adds a constraint to a model by parsing an OML expression.
Public method AddConstraints Adds a group of constraints to a model.
Public method AddDecision(Decision) Adds a decision to a model.
Public method AddDecision(RecourseDecision) Adds a recourse decision to a model (for stochastic programming).
Public method AddDecisions(array<Decision[]) Adds a group of decisions to a model.
Public method AddDecisions(array<RecourseDecision[]) Adds a group of recourse decisions to a model (for stochastic programming).
Public method AddGoal(String, GoalKind, Term) Adds a goal to a model.
Public method AddGoal(String, GoalKind, String) Adds a goal to a model by parsing an OML expression.
Public method AddGoals Adds a group of goals to a model.
Public method AddParameter(Parameter) Adds a parameter to a model.
Public method AddParameter(RandomParameter) Adds a random parameter to a model for stochastic programming.
Public method AddParameters(array<Parameter[]) Adds a group of parameters to a model.
Public method AddParameters(array<RandomParameter[]) Adds a group of random parameters to a model for stochastic programming.
Public method AddTuple Adds a tuple to a model.
Public method AddTuples Adds a group of tuples to a model.
Public methodStatic member AllDifferent Ensures that all terms in a model are different.
Public methodStatic member And Performs a Boolean AND operation.
Public methodStatic member ArcCos Computes the arccosine of a term.
Public methodStatic member ArcSin Computes the arcsine of a term.
Public methodStatic member ArcTan Computes the arctangent of a term.
Public methodStatic member AtMostMofN Tests whether a maximum of m inputs are true.
Public methodStatic member Ceiling Computes the smallest integer that is greater than or equal to the argument.
Public methodStatic member Cos Computes the cosine of a term.
Public methodStatic member Cosh Computers the hyperbolic cosine
Public method CreateInstance Creates an instance of a model.
Public method CreateSubModel Creates a submodel within the current model.
Public methodStatic member Difference Subtracts one term from another term.
Public methodStatic member Equal(array<Term[]) Tests all inputs for equality.
Public methodStatic member Equal(array<Term[], Tuples) Tests a tuple for membership in an array of tuples.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodStatic member ExactlyMofN Tests whether exactly a specified number of inputs are true.
Public methodStatic member Exp Computes e raised to the power specified by the input.
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 methodStatic member Floor Computes the largest integer that is less than or equal to the argument.
Public methodStatic member ForEach Creates a term for each element.
Public methodStatic member ForEachWhere Creates a term for each element if a condition is met.
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 methodStatic member Greater Tests whether all inputs occur in decreasing order.
Public methodStatic member GreaterEqual Tests whether all inputs are decreasing or equal in value.
Public methodStatic member If Returns the second or third argument, depending on whether the condition is true.
Public methodStatic member Implies Tests for logical implication between two inputs.
Public methodStatic member Less Tests whether all inputs occur in increasing order.
Public methodStatic member LessEqual Tests whether all inputs are increasing or equal in value.
Public methodStatic member Log Computes the natural logarithm of the term.
Public methodStatic member Log10 Computes the base 10 logarithm of the term.
Public methodStatic member Max Returns the largest argument.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic member Min Returns the smallest argument.
Public methodStatic member Negate Computes the arithmetic negation of a term.
Public methodStatic member Not Computes the logical negation of a term.
Public methodStatic member Or Performs a logical OR operation on a term.
Public methodStatic member Power Raises a term to the power of a specified value.
Public methodStatic member Product Multiplies all the inputs.
Public methodStatic member Quotient Divides one term by another.
Public method RemoveConstraint Removes a constraint from a model.
Public method RemoveDecision(Decision) Removes an unused decision from a model.
Public method RemoveDecision(RecourseDecision) Removes an unused recourse decision from a model.
Public method RemoveGoal Removes a goal from a model.
Public method RemoveGoals Removes goals from a model.
Public method RemoveParameter(Parameter) Removes an unused parameter from a model.
Public method RemoveParameter(RandomParameter) Removes an unused random parameter from a model.
Public method RemoveSubModel Removes a submodel from a model.
Public methodStatic member Sin Computes the sine for a term.
Public methodStatic member Sinh Computes the hyperbolic sine for a term.
Public methodStatic member Sos1 Creates a constraint for a special ordered type 1 set.
Public methodStatic member Sos2 Creates a constraint for a special ordered set reference row.
Public methodStatic member Sqrt Computes the square root for a term.
Public methodStatic member Sum(array<Term[]) Computes the sum of the inputs.
Public methodStatic member Sum(Term, Term) Computes the sum of the inputs.
Public methodStatic member Tan Computes the tangent for a term.
Public methodStatic member Tanh Computes the hyperbolic tangent for a term.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

The Model class can be used to construct and modify models. You can add arithmetic and logical expressions to models. In addition, you can add constraints expressed over domains of Boolean, integer, and real variables.

The items that make up a Model object are Goals, Constraints, Parameters, and Decisions properties.

You can load, save, and solve models by using the SolverContext class.

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

Reference

Microsoft.SolverFoundation.Services Namespace