public class EnforcedLinearConstraint
extends java.lang.Object
Constructor and Description |
---|
EnforcedLinearConstraint(ModelBuilderHelper helper) |
Modifier and Type | Method and Description |
---|---|
void |
addTerm(Variable v,
double coeff)
Adds var * coeff to the constraint.
|
void |
clearTerms()
Clear all terms.
|
ModelBuilderHelper |
getHelper()
Returns the constraint builder.
|
int |
getIndex()
Returns the index of the constraint in the model.
|
boolean |
getIndicatorValue()
Returns the indicator value of the constraint.
|
Variable |
getIndicatorVariable()
Returns the indicator variable of the constraint/
|
double |
getLowerBound()
Returns the lower bound of the constraint.
|
java.lang.String |
getName()
Returns the name of the constraint given upon creation.
|
double |
getUpperBound()
Returns the upper bound of the constraint.
|
void |
setCoefficient(Variable v,
double coeff)
Sets the coefficient of v to coeff, adding or removing a term if needed.
|
void |
setIndicatorValue(boolean b)
Sets the indicator value of the constraint.
|
void |
setIndicatorVariable(Variable v)
Sets the indicator variable of the constraint.
|
void |
setLowerBound(double lb)
Sets the lower bound of the constraint.
|
void |
setName(java.lang.String name) |
void |
setUpperBound(double ub)
Sets the upper bound of the constraint.
|
EnforcedLinearConstraint |
withName(java.lang.String name)
Inline setter
|
public EnforcedLinearConstraint(ModelBuilderHelper helper)
public int getIndex()
public ModelBuilderHelper getHelper()
public double getLowerBound()
public void setLowerBound(double lb)
public double getUpperBound()
public void setUpperBound(double ub)
public java.lang.String getName()
public void setName(java.lang.String name)
public void addTerm(Variable v, double coeff)
public void setCoefficient(Variable v, double coeff)
public void clearTerms()
public Variable getIndicatorVariable()
public void setIndicatorVariable(Variable v)
public boolean getIndicatorValue()
public void setIndicatorValue(boolean b)
public EnforcedLinearConstraint withName(java.lang.String name)
Copyright © 2025. All rights reserved.