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

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

See Also

Reference

Model Class

AddConstraint Overload

Microsoft.SolverFoundation.Services Namespace