I was using glpsol with a .mod file containing both the problem and the data for it.
However, I want to use its Java API to instantiate the problem within my application, without the need to write/read files and run them with glpsol.
In my problem, I have "sets" that are given afterwards in the data section, and also params in function of these sets, for example:
set ROBOTS;
param L{ROBOTS}, integer;
And then, at the data section:
data;
set ROBOTS := ag1 ag2 ag3;
What I want to know is what method can I use to add such params to the problem, as well as how to retrieve them.
In order to observe how this problem was being represented, I've tried reading the problem and the data from files and extracted the rows and cols of the problem through the methods glp_get_row_name and glp_get_col_name. I came to the conclusion that the rows are the objective and constraints, whilst the columns are the values of a var f that is declared as follows and used in some of the constraints as well as in the objective:
var f{ROBOTS,SUBTASKS}, binary;
I could not find in the documentation a way to extract these params from the problem. Also, I have no idea about where my other vars went, since only f appeared in the columns. But as the program was able to solve the instantiated problem and had the same result as the solution given by glpsol, I know that it has all of this data, I just want to know where it stores it.
I was reading the documentation from here: http://glpk-java.sourceforge.net/apidocs/org/gnu/glpk/GLPK.html
Sorry for the lack of correct terminology. Thanks in advance.
ROBOTS and SUBTASKS only exist in the GMPL language model. After the model is translated the problem is stored as a sparse matrix. You only have column numbers and row numbers for addressing.