sasoptpy.actions.unfix

unfix(*args)[source]

Unfixes values of variables

Parameters
argssasoptpy.Variable objects

Set of arguments to be unfixed

Examples

Regular unfix statement:

>>> with so.Workspace('w') as w:
>>>     x = so.Variable(name='x')
>>>     fix(x, 1)
>>>     solve()
>>>     unfix(x)
>>> print(so.to_optmodel(w))
proc optmodel;
    var x;
    fix x=1;
    solve;
    unfix x;
quit;

Multiple fix-unfix:

>>> with so.Workspace('w') as w:
>>>     x = so.VariableGroup(4, name='x')
>>>     for i in cofor_loop(range(4)):
>>>         fix((x[0], i), (x[1], 1))
>>>         solve()
>>>         unfix(x[0], (x[1], 2))
>>> print(so.to_optmodel(w))
proc optmodel;
    var x {{0,1,2,3}};
    cofor {o7 in 0..3} do;
        fix x[0]=o7 x[1]=1;
        solve;
        unfix x[0] x[1]=2;
    end;
quit;