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
I'm curious about the way variables are declared in rmpl compared to ompr and why the way how to do it changed or what the idea is behind this change.
rmpk
x <- model$add_variable(i = 1:n, j = 1:n, k = 1:9, type = "binary")
vs ompr
add_variable(model, x[i, j, k], i = 1:n, j = 1:n, k = 1:9, type = "binary")
I personally find the "ompr" way much better readable and much more consistent with regards to how the objective and the constraints are set and added.
Also, from reading the Julia/JuMP documentation: Is there not the risk of "mixing" R variables with "rmpk variables", e.g. x should be a R variable whereas in add_variable(model, x)x is something like a reference from the model variable x to the variable representation in the solver (I hope that makes sense). I think it would be beneficial if the syntax would be consistent and look something like
add_variable(model, x[i], I = index_set, name = "...")
add_constraint(model, expression, quantifier, name = "...")
add_objective(model, ...) or set_objective()
This should be equivalent to
model$add_variable(x[i], I = index_set, name = "...")
model$add_constraint(expression, quantifier, name = "...")
model$add_objective(, ...)
Thanks a lot for your great work!
Dirk
The text was updated successfully, but these errors were encountered:
Thanks for the feedback. #33 and PR #36 are related to this interface idea.
I also like the ompr interface, but I would also like to have direct control over the model/ without any non-standard evaluation. One problem with e.g. add_variable(model, x[i, j, k], ...) is that it if used within a package you will get an R CMD check error, due to unassigned variable usage.
But yeah, I want to offer an api that is very similiar (or even fully compatible) to ompr but also have a more lower level interface using the R6 class. At least for now. Some steps have been made in PR #36 :)
Hi Dirk,
I'm curious about the way variables are declared in rmpl compared to ompr and why the way how to do it changed or what the idea is behind this change.
rmpk
vs ompr
I personally find the "ompr" way much better readable and much more consistent with regards to how the objective and the constraints are set and added.
Also, from reading the Julia/JuMP documentation: Is there not the risk of "mixing" R variables with "rmpk variables", e.g.
x
should be a R variable whereas inadd_variable(model, x)
x
is something like a reference from the model variablex
to the variable representation in the solver (I hope that makes sense). I think it would be beneficial if the syntax would be consistent and look something likeThis should be equivalent to
Thanks a lot for your great work!
Dirk
The text was updated successfully, but these errors were encountered: