I am using lpsolveAPI in RStudio. When I type a model name with several decision variables, I can read a listing of the current constraints in the model. for instance
> lprec Model name: COLONE COLTWO COLTHREE COLFOUR Minimize 1 3 6.24 0.1 THISROW 0 78.26 0 2.9 >= 92.3 THATROW 0.24 0 11.31 0 <= 14.8 LASTROW 12.68 0 0.08 0.9 >= 4 Type Real Real Real Real Upper Inf Inf Inf 48.98 Lower 28.6 0 0 18
But when I make a model with more than 9 solution variables, it no longer gives a complete summary, and I see:
> lprec Model name: a linear program with 13 decision variables and 258 constraints
Does anyone know how I can see the same detailed model summary when there are a large number of decision variables?
Bonus question: is RStudio the best console for working with R?
Here is an example:
>lprec <- make.lp(0,5)
This creates a new model called lprec, with 0 constraints and 5 variables. Even if you call the name now, you get:
>lprec Model name: C1 C2 C3 C4 C5 Minimize 0 0 0 0 0 Kind Std Std Std Std Std Type Real Real Real Real Real Upper Inf Inf Inf Inf Inf Lower 0 0 0 0 0
Columns C correspond to 5 variables. There are no restrictions right now, and the objective function is 0.
You can add a restriction with
>add.constraint(lprec, c(1,3,4,2,-8), "<=", 0)
This is the restriction C1 + 3 * C2 + 4 * C3 + 2 * C4 - 8 * C5 = 0. Now the printout:
Model name: C1 C2 C3 C4 C5 Minimize 0 0 0 0 0 R1 1 3 4 2 -8 <= 0 Kind Std Std Std Std Std Type Real Real Real Real Real Upper Inf Inf Inf Inf Inf Lower 0 0 0 0 0
In any case, the fact is that no matter how many restrictions, if there are more than 9 variables, I do not get the full listing.
>lprec <- make.lp(0,15) >lprec Model name: a linear program with 15 decision variables and 0 constraints