As a follow-up to IainNZ’s comments on issue #399, I’ve slightly modified the code to experiment with variable fixings. While I only intend to fix variables of the object r, the fixings are applied to object p as well. I don’t quite understand the functioning of the fixings here. Could someone elaborate on what’s happening behind the scenes?
using JuMP
using CPLEX
type MyProblem
model
x
y
end
function createproblem()
m = Model(solver=CplexSolver())
@variable(m, 0 <= x <= 2 )
@variable(m, 0 <= y <= 30 )
@objective(m, Max, 5x + 3*y )
@constraint(m, 2x + 5y <= 3.0 )
return MyProblem(m, x, y)
end
p = createproblem()
r = p
setlowerbound(r.x, 2)
setupperbound(r.x, 2)
solve(r.model)
solve(p.model)