Class Variable

java.lang.Object
com.google.ortools.modelbuilder.Variable
All Implemented Interfaces:
LinearArgument

public class Variable extends Object implements LinearArgument
An integer variable.
  • Field Details

  • Method Details

    • getIndex

      public int getIndex()
      Returns the index of the variable in the underlying ModelBuilderHelper.
    • build

      public LinearExpr build()
      Description copied from interface: LinearArgument
      Builds a linear expression.
      Specified by:
      build in interface LinearArgument
    • 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

      public String getName()
      Returns the name of the variable given upon creation.
    • setName

      public void setName(String name)
    • toString

      public String toString()
      Overrides:
      toString in class Object