Class Variable
java.lang.Object
com.google.ortools.modelbuilder.Variable
- All Implemented Interfaces:
LinearArgument
An integer variable.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a linear expression.intgetIndex()Returns the index of the variable in the underlying ModelBuilderHelper.booleanReturns whether the variable is integral.doubleReturns the lower bound of the variable.getName()Returns the name of the variable given upon creation.doubleReturns the objective coefficient of the variable.doubleReturns the upper bound of the variable.voidsetIntegrality(boolean isIntegral) Sets the integrality of the variable.voidsetLowerBound(double lowerBound) Sets the lower bound of the variable.voidvoidsetObjectiveCoefficient(double objectiveCoefficient) Sets the objective coefficient of the variable in the objective.voidsetUpperBound(double upperBound) Sets the upper bound of the variable.toString()
-
Field Details
-
helper
-
index
protected final int index
-
-
Method Details
-
getIndex
public int getIndex()Returns the index of the variable in the underlying ModelBuilderHelper. -
build
Description copied from interface:LinearArgumentBuilds a linear expression.- Specified by:
buildin interfaceLinearArgument
-
getLowerBound
public double getLowerBound()Returns the lower bound of the variable. -
setLowerBound
public void setLowerBound(double lowerBound) Sets the lower bound of the variable. -
getUpperBound
public double getUpperBound()Returns the upper bound of the variable. -
setUpperBound
public void setUpperBound(double upperBound) Sets the upper bound of the variable. -
getIntegrality
public boolean getIntegrality()Returns whether the variable is integral. -
setIntegrality
public void setIntegrality(boolean isIntegral) Sets the integrality of the variable. -
getObjectiveCoefficient
public double getObjectiveCoefficient()Returns the objective coefficient of the variable. -
setObjectiveCoefficient
public void setObjectiveCoefficient(double objectiveCoefficient) Sets the objective coefficient of the variable in the objective. -
getName
Returns the name of the variable given upon creation. -
setName
-
toString
-