-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equality constraint for interval variables #12
Comments
The problem when you remove these checks is when you remove constraints to update the bounds. It's the same reason why CPLEX.jl forbids having several bounds per variable (see the calls to Do you have the same problem when going through JuMP instead of attacking directly CPLEXCP.jl? |
Sorry for the late response. Yes, I did, at least I think so: using JuMP
using CPLEX
model = direct_model(CPLEX.Optimizer())
@variable(model, x, lower_bound = 0, upper_bound = 15, integer = true)
@variable(model, 0 <= y <= 3)
@objective(model, Min, 12x + 20y)
@constraint(model, c1, 6x + 8y >= 100)
@constraint(model, c2, 7x + 12y >= 120)
@constraint(model, c3, x >= 15)
print(model)
optimize!(model)
@show termination_status(model)
@show primal_status(model)
@show objective_value(model)
@show value(x)
@show value(y) Let me know if this is the setup you are looking for? |
I had in mind the most usual way to use JuMP, i.e. |
Sorry, I think I got the wrong understanding, are we talking about running CPLEXCP or CPLEX via JuMP ? |
Hello.
While working on the issue #11, I found other "bug". Conside the below code.
Which returns the below message.
I tried to comment the lines
_assert_no_lb(model, f, s)
and_assert_no_ub(model, f, s)
of the functionadd_constraint
, and no bug appeared.I understand the meaning of line
@assert _info(model, f).type == _type_to_variabletype(T)
, but I do not see the reason for the asserts on the bounds. Is there any special concern on this?Thanks and regards.
The text was updated successfully, but these errors were encountered: