Class EnforcedLinearConstraint


  • public class EnforcedLinearConstraint
    extends java.lang.Object
    Wrapper around a linear constraint stored in the ModelBuilderHelper instance.
    • Constructor Detail

      • EnforcedLinearConstraint

        public EnforcedLinearConstraint​(ModelBuilderHelper helper)
    • Method Detail

      • getIndex

        public int getIndex()
        Returns the index of the constraint in the model.
      • 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

        public java.lang.String getName()
        Returns the name of the constraint given upon creation.
      • setName

        public void setName​(java.lang.String name)
      • addTerm

        public void addTerm​(Variable v,
                            double coeff)
        Adds var * coeff to the constraint.
      • setCoefficient

        public void setCoefficient​(Variable v,
                                   double coeff)
        Sets the coefficient of v to coeff, adding or removing a term if needed.
      • clearTerms

        public void clearTerms()
        Clear all terms.
      • getIndicatorVariable

        public Variable getIndicatorVariable()
        Returns the indicator variable of the constraint/
      • setIndicatorVariable

        public void setIndicatorVariable​(Variable v)
        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.