[R-SIG-Finance] Mixed integer programming

Hannu Kahra hk@hr@ @end|ng |rom gm@||@com
Tue Feb 19 13:10:37 CET 2019

I have tried to replicate Example 5.1 in Luenberger: Investment Science.

Here is the model
model <- MIPModel() %>%
  add_variable(x[i], i = 1:7, type = "binary") %>%

<= 500)
solve_model(with_ROI("glpk",verbose = TRUE))

I get the following error

Error in UseMethod("solve_model") :
  no applicable method for 'solve_model' applied to an object of class

 modelMixed integer linear optimization problem
  Continuous: 0
  Integer: 0
  Binary: 7
Model sense: maximize
Constraints: 1

What is wrong? Thank you in advance.


	[[alternative HTML version deleted]]

More information about the R-SIG-Finance mailing list