sasoptpy.Model.get_variable

Model.get_variable(self, name)[source]

Returns the reference to a variable in the model

Parameters
namestring

Name or key of the variable requested

Returns
variableVariable

Reference to the variable

Examples

>>> m.add_variable(name='x', vartype=so.INT, lb=3, ub=5)
>>> var1 = m.get_variable('x')
>>> print(repr(var1))
sasoptpy.Variable(name='x', lb=3, ub=5, vartype='INT')