RHS Value
Awaiting user inputHello,
I get the RHS value of constraints with:
for c in model.getConstrs():
c.rhs
However, for the RHS values less than 0.05, c.rhs gives 0. I would like to know whether it is possible to obtain the exact value of RHS in any case.
Thank you for your help.

The RHS attribute should capture the exact value of the constraint's righthand side. Note that Gurobi moves all constants in the constraint over to the righthand side:
>>> c = m.addConstr(x + 0.03125 <= 0.0625)
>>> m.update()
>>> c.RHS
0.03125Alternatively, is it possible the printed RHS values are formatted to show only one decimal place?
If neither of those suggestions help, can you please post a few lines of selfcontained code that reproduce the behavior you're seeing? It would also be helpful to know where you are running the code (in an interactive shell, Jupyter notebook, IDE, etc.).
0
Please sign in to leave a comment.
Comments
1 comment