Hello Jiri,

the example below relies on Trucks and Stocks being ordered sets.

Best regards

Xypron

set Trucks;
set Stocks;
param load{Trucks, Stocks} := if (Uniform01()) < .5 then 0. else Uniform01();
solve;
table ta {t in Trucks, s in Stocks : load[t,s] > 0} OUT 'CSV' 'test.csv' :
sum{u in Trucks, v in Stocks : load[u,v] > 0 && (u < t || (u == t && v < s ) ) } 1 + 1 ~ Counter,
t ~ Truck, s ~ Stock, load[t,s] ~ Load;
display load;
data;
set Trucks := T1 T2 T3 T4;
set Stocks := S1 S2 S3;
end;


Jiri K wrote:
Hello,
I am using the standalone GLPK solver and I extract outputs into csv file.
Would anyone have an idea how to achieve the following?:

In the table:
table result {t in TRUCK:sum{s in STOCK}load[s,t]>0} OUT "CSV"
".output.csv": (etc)

I would like to have a field with numbers going 1, 2, 3... as far as the
table reaches. Please note that load[s,t] is a variable, so only at the end
of the calculation it is clear, which t in TRUCK will be included in the
output.

I will be happy for any advice.

Jiri



_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to