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.int
getIndex()
Returns the index of the variable in the underlying ModelBuilderHelper.boolean
Returns whether the variable is integral.double
Returns the lower bound of the variable.getName()
Returns the name of the variable given upon creation.double
Returns the objective coefficient of the variable.double
Returns the upper bound of the variable.void
setIntegrality
(boolean isIntegral) Sets the integrality of the variable.void
setLowerBound
(double lowerBound) Sets the lower bound of the variable.void
void
setObjectiveCoefficient
(double objectiveCoefficient) Sets the objective coefficient of the variable in the objective.void
setUpperBound
(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:LinearArgument
Builds a linear expression.- Specified by:
build
in 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
-