sasoptpy.actions.drop

drop(*args)[source]

Drops the specified constraints or constraint groups from model

Parameters
argssasoptpy.Constraint, sasoptpy.ConstraintGroup

Constraints to be dropped

Examples

>>> with so.Workspace('w') as w:
>>>     x = so.Variable(name='x', lb=1)
>>>     y = so.Variable(name='y', lb=0)
>>>     c = so.Constraint(sm.sqrt(x) >= 5, name='c')
>>>     o = so.Objective(x + y, sense=so.MIN, name='obj')
>>>     s = solve()
>>>     drop(c)
>>>     o2 = so.Objective(x, sense=so.MIN, name='obj2')
>>>     s2 = solve()
>>> print(so.to_optmodel(w))
proc optmodel;
    var x >= 1;
    var y >= 0;
    con c : sqrt(x) >= 5;
    min obj = x + y;
    solve;
    drop c;
    min obj2 = x;
    solve;
quit;