help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Special key in csv output


From: Jiri K
Subject: Re: [Help-glpk] Special key in csv output
Date: Mon, 25 Oct 2010 00:12:39 -0700 (PDT)

Hello Xypron,
thank you very much, this is what I was looking for.
Best regards
Jiri



xypron wrote:
> 
> 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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Special-key-in-csv-output-tp30020217p30045323.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]