-
Notifications
You must be signed in to change notification settings - Fork 35
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
Binary variable <= Binary matrix: Error in constraint$lhs - constraint$rhs : non-numeric argument to binary operator #422
Comments
Right. MILPModel was formulated with significant performance improvement over the original MIPModel. But using arrays in MILPModel constraints requires the use of the So it is my impression now that the updated MIPModel supercedes MILPModel. So your MIPModel version is what you should use. |
OK, I'm actually (sorta) used to using |
BTW, you may want to install the development versions of ompr, ompr.roi to ensure that the latest functionality is being accessed by your MIPModel formulation:
|
Thanks, I'll try that. Right now I'm using the latest CRAN versions of both ompr and ompr.roi. I'm also using some random version of ROI.plugin.gurobi I was able to successfully install |
I am building a
MILPModel
where the primary decision variables are binary,x[i,j]
. Depending upon thei,j
pair, I may want to forcex[i,j]
to 0 instead of giving the model the choice of 0 or 1. I have a static matrix,allowed_binary
, that isi
rows andj
columns, with value of 0 ifx[i,j]
must be 0, and a value of 1 ifx[i,j]
can be 0 or 1. I made a very simple constraint:add_constraint(x[i,j] <= allowed_binary[i,j], i=1:10, j = 1:20)
This constraint is accepted by
ompr
with aMIPModel
but when I add it in aMILPModel
, I get the errorError in constraint$lhs - constraint$rhs : non-numeric argument to binary operator
. Is this because of howMILPModel
handles multidimensional decision variables? I could probably form my decision variablesx
to be along a single vector if necessary.The text was updated successfully, but these errors were encountered: