sasoptpy.Model.get_constraints

Model.get_constraints(self)[source]

Returns a list of constraints in the model

Returns
constraintslist

A list of Constraint objects

Examples

>>> m.add_constraint(x[0] + y <= 15, name='c1')
>>> m.add_constraints((2 * x[i] - y >= 1 for i in [0, 1]), name='c2')
>>> print(m.get_constraints())
[sasoptpy.Constraint( x[0]  +  y  <=  15, name='c1'),
 sasoptpy.Constraint( 2.0 * x[0]  -  y  >=  1, name='c2_0'),
 sasoptpy.Constraint( 2.0 * x[1]  -  y  >=  1, name='c2_1')]