Variable update doesn´t work Pyomo Solver Persisten

37 views Asked by At

I´m trying to use the Pyomo framework with Persistent Solver to implement the Relax-and-Fix heuristic. But, can´t update the variable domain correctly and I need help.

My model has a variable Z (orinally binary) that must be relaxed to implement the Relax-and-Fix heuristic:

model.z = pyo.Var(model.set_E, model.set_I, model.set_F, model.set_T, within =NonNegativeReals)
z = model.z


# Change the domaing of Z variable.
#  expect that for each iteration the Z variable domain only will be Binary in this intervalue:
for e in model.set_E:
    for i in model.set_I:
        for f in model.set_F: 
            for t in model.set_T:
                if  t >= HR_ini and t < HR_ini + HR_tau+1:
                    model.z[e,i,f,t].domain = Binary
                    opt.update_var(z[e,i,f,t]) # this method update dosen´t works

Could someone help me? I already stuck in this issue during three weeks. Best regards!

0

There are 0 answers