Model.AddConstraint Method (String, Term)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Adds a constraint to the model..
Namespace: Microsoft.SolverFoundation.Services
Assembly: Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)
Syntax
'Declaration
Public Function AddConstraint ( _
name As String, _
constraint As Term _
) As Constraint
public Constraint AddConstraint(
string name,
Term constraint
)
public:
Constraint^ AddConstraint(
String^ name,
Term^ constraint
)
member AddConstraint :
name:string *
constraint:Term -> Constraint
public function AddConstraint(
name : String,
constraint : Term
) : Constraint
Parameters
- name
Type: System.String
The name of the constraint.
- constraint
Type: Microsoft.SolverFoundation.Services.Term
The constraint.
Return Value
Type: Microsoft.SolverFoundation.Services.Constraint
A constraint for the model.
Exceptions
Exception | Condition |
---|---|
ModelException | The model is not valid. |
Remarks
The constraint parameter should evaluate to a boolean result.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.