C++ Reference: class CpModelBuilder
Note: This documentation is automatically generated.
Method | |
---|---|
AddAbsEquality | Return type: Arguments: Adds target == abs(expr). |
AddAllDifferent | Return type: Arguments: This constraint forces all variables to have different values. |
AddAllDifferent | Return type: Arguments: This constraint forces all expressions to have different values. |
AddAllDifferent | Return type: Arguments: This constraint forces all expressions to have different values. |
AddAllowedAssignments | Return type: Arguments: |
AddAssumption | Return type: Arguments: Adds a literal to the model as assumptions. |
AddAssumptions | Return type: Arguments: Adds multiple literals to the model as assumptions. |
AddAtLeastOne | Return type: Arguments: Same as AddBoolOr(). Sum literals >= 1. |
AddAtMostOne | Return type: Arguments: At most one literal is true. Sum literals <= 1. |
AddAutomaton | Return type: Arguments: |
AddBoolAnd | Return type: Arguments: Adds the constraint that all literals must be true. |
AddBoolOr | Return type: Arguments: Adds the constraint that at least one of the literals must be true. |
AddBoolXor | Return type: Arguments: Adds the constraint that an odd number of literals is true. |
AddCircuitConstraint | Return type: |
AddCumulative | Return type: Arguments: |
AddDecisionStrategy | Return type: Arguments: Adds a decision strategy on a list of integer variables. |
AddDecisionStrategy | Return type: Arguments: Adds a decision strategy on a list of boolean variables. |
AddDivisionEquality | Return type: Arguments: Adds target = num / denom (integer division rounded towards 0). |
AddElement | Return type: Arguments: Adds the element constraint: values[index] == target |
AddEquality | Return type: Arguments: Adds left == right. |
AddExactlyOne | Return type: Arguments: Exactly one literal is true. Sum literals == 1. |
AddForbiddenAssignments | Return type: Arguments: |
AddGreaterOrEqual | Return type: Arguments: Adds left >= right. |
AddGreaterThan | Return type: Arguments: Adds left > right. |
AddHint | Return type: Arguments: Adds hinting to a variable. |
AddHint | Return type: Arguments: Adds hinting to a Boolean variable. |
AddImplication | Return type: Arguments: Adds a => b. |
AddImplication | Return type: Arguments: Adds implication: if all lhs vars are true then all rhs vars must be true. |
AddInverseConstraint | Return type: Arguments: |
AddLessOrEqual | Return type: Arguments: Adds left <= right. |
AddLessThan | Return type: Arguments: Adds left < right. |
AddLinearConstraint | Return type: Arguments: Adds expr in domain. |
AddMaxEquality | Return type: Arguments: Adds target == max(vars). |
AddMaxEquality | Return type: Arguments: Adds target == max(exprs). |
AddMaxEquality | Return type: Arguments: Adds target == max(exprs). |
AddMinEquality | Return type: Arguments: Adds target == min(vars). |
AddMinEquality | Return type: Arguments: Adds target == min(exprs). |
AddMinEquality | Return type: Arguments: Adds target == min(exprs). |
AddModuloEquality | Return type: Arguments: Adds target = var % mod. |
AddMultipleCircuitConstraint | Return type: |
AddMultiplicationEquality | Return type: Arguments: Adds target == prod(exprs). |
AddMultiplicationEquality | Return type: Arguments: Adds target == prod(vars). |
AddMultiplicationEquality | Return type: Arguments: Adds target == prod(vars). |
AddMultiplicationEquality | Return type: Arguments: Adds target == left * right. |
AddNoOverlap | Return type: Arguments: |
AddNoOverlap2D | Return type: |
AddNotEqual | Return type: Arguments: Adds left != right. |
AddReservoirConstraint | Return type: Arguments: |
AddVariableElement | Return type: Arguments: Adds the element constraint: variables[index] == target |
Build | Return type: |
ClearAssumptions | Return type: Remove all assumptions from the model. |
ClearHints | Return type: Removes all hints. |
ClearObjective | Return type: Removes the objective from the model. |
CopyFrom | Return type: Arguments: Replaces the current model with the one from the given proto. |
FalseVar | Return type: Creates an always false Boolean variable. If this is called multiple times, the same variable will always be returned. |
FixVariable | Return type: Arguments: It is sometime convenient when building a model to create a bunch of variables that will later be fixed. Instead of doing AddEquality(var, value) which add a constraint, these functions modify directly the underlying variable domain. Note that this ignore completely the original variable domain and just fix the given variable to the given value, even if it was outside the given variable domain. You can still use AddEquality() if this is not what you want. |
FixVariable | Return type: Arguments: |
GetBoolVarFromProtoIndex | Return type: Arguments: Returns the Boolean variable from its index in the proto. |
GetIntervalVarFromProtoIndex | Return type: Arguments: Returns the interval variable from its index in the proto. |
GetIntVarFromProtoIndex | Return type: Arguments: Returns the integer variable from its index in the proto. |
HasObjective | Return type: Checks whether the model contains an objective. |
Maximize | Return type: Arguments: Adds a linear maximization objective. |
Maximize | Return type: Arguments: Adds a linear floating point maximization objective. Note that the coefficients will be internally scaled to integer. |
Minimize | Return type: Arguments: Adds a linear minimization objective. |
Minimize | Return type: Arguments: Adds a linear floating point minimization objective. Note that the coefficients will be internally scaled to integer. |
MutableProto | Return type: |
NewBoolVar | Return type: Creates a Boolean variable. |
NewConstant | Return type: Arguments: Creates a constant variable. This is a shortcut for NewVariable(Domain(value)).but it will return the same variable if used twice with the same constant. |
NewFixedSizeIntervalVar | Return type: Arguments: Creates an interval variable with a fixed size. |
NewIntervalVar | Return type: Arguments: Creates an interval variable from 3 affine expressions. |
NewIntVar | Return type: Arguments: Creates an integer variable with the given domain. |
NewOptionalFixedSizeIntervalVar | Return type: Arguments: Creates an optional interval variable with a fixed size. |
NewOptionalIntervalVar | Return type: Arguments: Creates an optional interval variable from 3 affine expressions and a Boolean variable. |
Proto | Return type: |
SetName | Return type: Arguments: Sets the name of the model. |
TrueVar | Return type: Creates an always true Boolean variable. If this is called multiple times, the same variable will always be returned. |