[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] CSV outputting MathProg for summary report mapulation
From: |
Meketon, Marc |
Subject: |
Re: [Help-glpk] CSV outputting MathProg for summary report mapulation |
Date: |
Thu, 1 Mar 2012 02:29:08 -0600 |
Printing out the CSV header using printf is probably doable with a statement
like:
printf {p in PRODUCT} : "%s," PRODUCT[p] > "filename.csv" ; #no "new line"
printf "DUMMY\n; #last one has the new line
The DUMMY was added because the last comma would be hanging out by itself
without it.
I would guess that you could dump out the data this way as well, but add a
dummy value at the end.
This is somewhat convoluted and probably there is a better way.
-----Original Message-----
From: Noli Sicad [mailto:address@hidden
Sent: Thursday, March 01, 2012 2:55 AM
To: Meketon, Marc
Cc: address@hidden
Subject: Re: [Help-glpk] CSV outputting MathProg for summary report mapulation
This is the data set for the problem.
set PRODUCT:=
TRV
SCOST
PCOST
P1P2
SLOG
PULP
CFREV
LCOST
TCOST
SACOST
RCOST;
#param Type{PRODUCT} symbolic; # Product (Final),
Thinning
(Intermediate), Residue
param Type:=
TRV Final
SCOST Intermediate
PCOST Intermediate
P1P2 Final
SLOG Final
PULP Final
CFREV Final
LCOST Final
TCOST Final
SACOST Final
RCOST Final;
#param Status{PRODUCT} symbolic; # Revenue, Cost, Yield, Ignore
param Status:=
TRV Yield
SCOST Cost
PCOST Cost
P1P2 Yield
SLOG Yield
PULP Yield
CFREV Revenue
LCOST Cost
TCOST Cost
SACOST Cost
RCOST Cost
;
Noli
On 3/1/12, Noli Sicad <address@hidden> wrote:
> Thanks for the suggestion.
>
>> Second line was incorrect. A better approximation is:
>>
>> printf " Period,ClearfellArea,TRV,P1P2,SLOG,PULP\n" > "filename.csv"
>> printf {(t,i,j) in HARVEST}: "%d,%f\n" t, sum {(t,i,j) in HARVEST}
>> Y[t,i,j]
>>>> "filename.csv"
>>
>
> However, TRV, P1P2, SLOG, PULP are inputs so it changes from time to
> time. It could not be hardcoded. Some of the data sets for case
> studies, the YIELD may have PRODUCTS where are P1, P2, SLOG1, SLOG2,
> K1, K2, C1, C2, PULP.
>
> Any suggestion how to do this using
>
> for {p in PRODUCT} { } syntax.
>
> #######################
>
> {p in PRODUCT: Status[p] in YIELD} <sum {(t,i,j) in HARVEST}
> Y[t,i,j]*Yield[p,i,j] ~ (p)>;
>
> Thanks.
>
> Noli
>
This e-mail and any attachments may be confidential or legally privileged. If
you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return e-mail.
Thank you for your cooperation.
Re: [Help-glpk] CSV outputting MathProg for summary report mapulation, Andrew Makhorin, 2012/03/01