sasoptpy.Constraint.set_rhs

Constraint.set_rhs(self, value)[source]

Changes the constant value (right-hand side) of a constraint

Parameters
valuefloat

New right-hand side value for the constraint

Examples

>>> x = m.add_variable(name='x')
>>> y = m.add_variable(name='y')
>>> c = m.add_constraint(x + 3*y <= 10, name='con_1')
>>> print(c)
x  +  3.0 * y  <=  10
>>> c.set_rhs(5)
>>> print(c)
x  +  3.0 * y  <=  5