Loading matrix param from Excel table in GLPK
Rodolfo Grosso <[email protected]>
| Newsgroups | gmane.comp.gnu.glpk |
|---|---|
| Message-ID | <CAMzhOQMVBcd79d5BKbh2KzUH8iRMrL6Rwk1rfpLpgK9A2cusjA@mail.gmail.com> |
Hi,
I want to pass matrix values contained in excel file or csv to a
matrix parameter, for example, Excel table:
AGU CEN
ITU 5 6
PMO 7 8
So that I can read through the parameter traffic:
traffic[ITU,AGU]=5
traffic[PMO,AGU]=7
...
In the real case there are many values.
For this, I made the following code, but it did not work:
set C1;
set C2;
param traffic_st{C1,C2} >=0;
table data IN "CSV" "traffic_st1.csv":
[i ~ C1], {j in C2} <traffic_st[i,j] ~ (j)>;
and I define C2 in .dat file like:
set C2:=AGU CEN;
Thank you in advance for your help
Best regards.
Rodolfo