public class Constraint
extends java.lang.Object
Constraints created by the CpModel class are automatically added to the model. One needs this class to add an enforcement literal to a constraint.
Constructor and Description |
---|
Constraint(CpModelProto.Builder builder) |
Modifier and Type | Method and Description |
---|---|
ConstraintProto.Builder |
getBuilder()
Returns the constraint builder.
|
int |
getIndex()
Returns the index of the constraint in the model.
|
void |
onlyEnforceIf(Literal lit)
Adds a literal to the constraint.
|
void |
onlyEnforceIf(Literal[] lits)
Adds a list of literals to the constraint.
|
public Constraint(CpModelProto.Builder builder)
public void onlyEnforceIf(Literal lit)
public void onlyEnforceIf(Literal[] lits)
public int getIndex()
public ConstraintProto.Builder getBuilder()
Copyright © 2025. All rights reserved.