r-opt / rmpk

Mixed Integer Linear and Quadratic Programming in R
https://r-opt.github.io/rmpk/
Other
44 stars 4 forks source link

Do not add variables to surrounding environment #23

Closed dirkschumacher closed 4 years ago

dirkschumacher commented 4 years ago

Although technically feaisble, it might not be something you would expect:

model$add_variable(x[i], type = "binary", i = 1:10)
x[5]

Maybe change it to:

x <- model$add_variable(i = 1:10, type = "binary")
x[5]