Export (0) Print
Expand All

Model.AddConstraint Method (String, Term)

Solver Foundation 3.0

[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)

public Constraint AddConstraint(
	string name,
	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.

ExceptionCondition
ModelException

The model is not valid.

The constraint parameter should evaluate to a boolean result.

Show:
© 2014 Microsoft