Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.Sat.Constraint Class Reference

Wrapper around a ConstraintProto. More...

Inheritance diagram for Google.OrTools.Sat.Constraint:
Google.OrTools.Sat.AutomatonConstraint Google.OrTools.Sat.CircuitConstraint Google.OrTools.Sat.CumulativeConstraint Google.OrTools.Sat.MultipleCircuitConstraint Google.OrTools.Sat.NoOverlap2dConstraint Google.OrTools.Sat.ReservoirConstraint Google.OrTools.Sat.TableConstraint

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Constraint()

Google.OrTools.Sat.Constraint.Constraint ( CpModelProto model)
inline

Definition at line 30 of file Constraints.cs.

Member Function Documentation

◆ OnlyEnforceIf() [1/2]

void Google.OrTools.Sat.Constraint.OnlyEnforceIf ( ILiteral lit)
inline

Adds a literal to the constraint.

Definition at line 38 of file Constraints.cs.

◆ OnlyEnforceIf() [2/2]

void Google.OrTools.Sat.Constraint.OnlyEnforceIf ( ILiteral[] lits)
inline

Adds a list of literals to the constraint.

Definition at line 44 of file Constraints.cs.

Property Documentation

◆ Index

int Google.OrTools.Sat.Constraint.Index
get

The index of the constraint in the model.

Definition at line 53 of file Constraints.cs.

◆ Proto

ConstraintProto Google.OrTools.Sat.Constraint.Proto
getset

The underlying constraint proto.

Definition at line 61 of file Constraints.cs.


The documentation for this class was generated from the following file: