sasoptpy.Model.get_constraint

Model.get_constraint(self, name)[source]

Returns the reference to a constraint in the model

Parameters
namestring

Name of the constraint requested

Returns
constraintConstraint

Requested object

Examples

>>> m.add_constraint(2 * x + y <= 15, name='c1')
>>> print(m.get_constraint('c1'))
2.0 * x  +  y  <=  15