library(magrittr)
MIPModel() %>%
add_variable(x[i], i = 1:5) %>%
add_constraint(x[i] >= 1, i = 1:5) %>% # creates 5 constraints
set_bounds(x[i], lb = 3, i = 1:3) %>%
variable_bounds()
MIPModel() %>%
add_variable(x[i], i = 1:5) %>%
set_bounds(x[i] <= i, i = 1:5) %>% # upper bound
set_bounds(x[i] >= 0, i = 1:5) %>% # lower bound
set_bounds(x[5] == 45) %>%
variable_bounds()
Run the code above in your browser using DataLab