You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to update or replace constraints after the model is instantiated?
Long version
I am currently solving an EPEC via diagonalization. This requires me to solve the bilevel problem several times by updating a set of constraints. Since creating a new model instance is a bit of a waste of time (models are very large), being able to update constraints would be very useful.
I have already done something similar using directly JuMP Models...
functionupdate!(model::JuMP.Model, new_values::Vector[Number], index_set)
# Remove and unregister existing fixing constraintsfor i ineachindex(model[:MyConstraintName])
delete(model, model[:MyConstraintName][i])
endunregister(model, :MyConstraintName)
# Add new Constraint@constraint(model, :MyConstraintName[i in index_set], model[::MyVariableName][i] .== new_values[i])
return model
end
However I failled to do the same with the BilevelJump since
Hi,
Is there a way to update or replace constraints after the model is instantiated?
Long version
I am currently solving an EPEC via diagonalization. This requires me to solve the bilevel problem several times by updating a set of constraints. Since creating a new model instance is a bit of a waste of time (models are very large), being able to update constraints would be very useful.
I have already done something similar using directly JuMP Models...
However I failled to do the same with the BilevelJump since
calls this function:
Thanks!
The text was updated successfully, but these errors were encountered: