Class EnforcedLinearConstraint
java.lang.Object
com.google.ortools.modelbuilder.EnforcedLinearConstraint
Wrapper around a linear constraint stored in the ModelBuilderHelper instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds var * coeff to the constraint.voidClear all terms.Returns the constraint builder.intgetIndex()Returns the index of the constraint in the model.booleanReturns the indicator value of the constraint.Returns the indicator variable of the constraint/doubleReturns the lower bound of the constraint.getName()Returns the name of the constraint given upon creation.doubleReturns the upper bound of the constraint.voidsetCoefficient(Variable v, double coeff) Sets the coefficient of v to coeff, adding or removing a term if needed.voidsetIndicatorValue(boolean b) Sets the indicator value of the constraint.voidSets the indicator variable of the constraint.voidsetLowerBound(double lb) Sets the lower bound of the constraint.voidvoidsetUpperBound(double ub) Sets the upper bound of the constraint.Inline setter
-
Constructor Details
-
EnforcedLinearConstraint
-
-
Method Details
-
getIndex
public int getIndex()Returns the index of the constraint in the model. -
getHelper
Returns the constraint builder. -
getLowerBound
public double getLowerBound()Returns the lower bound of the constraint. -
setLowerBound
public void setLowerBound(double lb) Sets the lower bound of the constraint. -
getUpperBound
public double getUpperBound()Returns the upper bound of the constraint. -
setUpperBound
public void setUpperBound(double ub) Sets the upper bound of the constraint. -
getName
Returns the name of the constraint given upon creation. -
setName
-
addTerm
Adds var * coeff to the constraint. -
setCoefficient
Sets the coefficient of v to coeff, adding or removing a term if needed. -
clearTerms
public void clearTerms()Clear all terms. -
getIndicatorVariable
Returns the indicator variable of the constraint/ -
setIndicatorVariable
Sets the indicator variable of the constraint. -
getIndicatorValue
public boolean getIndicatorValue()Returns the indicator value of the constraint. -
setIndicatorValue
public void setIndicatorValue(boolean b) Sets the indicator value of the constraint. -
withName
Inline setter
-