sasoptpy.Variable¶
-
class
Variable(**kwargs)[source]¶ Bases:
sasoptpy.core.expression.ExpressionCreates an optimization variable to be used inside models
- Parameters
- namestring
Name of the variable
- vartypestring, optional
Type of the variable
- lbfloat, optional
Lower bound of the variable
- ubfloat, optional
Upper bound of the variable
- initfloat, optional
Initial value of the variable
- abstractboolean, optional
When set to True, indicates that the variable is abstract
See also
Examples
>>> x = so.Variable(name='x', lb=0, ub=20, vartype=so.CONT) >>> print(repr(x)) sasoptpy.Variable(name='x', lb=0, ub=20, vartype='CONT')
>>> y = so.Variable(name='y', init=1, vartype=so.INT) >>> print(repr(y)) sasoptpy.Variable(name='y', lb=0, ub=inf, init=1, vartype='INT')
- Attributes
lbLower bound of the variable
ubUpper bound of the variable