![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Wrapper around a ConstraintProto. More...
Wrapper around a ConstraintProto.
Constraints created by the CpModel class are automatically added to the model. One needs this class to add an enforcement literal to a constraint.
Definition at line 28 of file Constraints.cs.
Public Member Functions | |
| Constraint (CpModelProto model) | |
| void | OnlyEnforceIf (ILiteral lit) |
| Adds a literal to the constraint. | |
| void | OnlyEnforceIf (ILiteral[] lits) |
| Adds a list of literals to the constraint. | |
Properties | |
| int | Index [get] |
| The index of the constraint in the model. | |
| ConstraintProto | Proto [get, set] |
| The underlying constraint proto. | |
|
inline |
Definition at line 30 of file Constraints.cs.
|
inline |
Adds a literal to the constraint.
Definition at line 38 of file Constraints.cs.
|
inline |
Adds a list of literals to the constraint.
Definition at line 44 of file Constraints.cs.
|
get |
The index of the constraint in the model.
Definition at line 53 of file Constraints.cs.
|
getset |
The underlying constraint proto.
Definition at line 61 of file Constraints.cs.