linopy.variables.ScalarVariable#
- class linopy.variables.ScalarVariable(label, model)#
A scalar variable container.
In contrast to the Variable class, a ScalarVariable only contains only one label. Use this class to create a expression or constraint in a rule.
- __init__(label, model)#
Methods
__init__
(label, model)to_linexpr
([coeff])to_scalar_linexpr
([coeff])Attributes
label
Get the label of the variable.
lower
Get the lower bound of the variable.
model
Get the model to which the variable belongs.
upper
Get the upper bound of the variable.