help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Printing constraint for report using printf and for


From: Noli Sicad
Subject: [Help-glpk] Printing constraint for report using printf and for
Date: Mon, 5 Mar 2012 18:38:12 +1100

Hi,

I want to print this constraint (below) as one of my reports i.e. screen output.

constraint
#############
subject to Mill_Demand_Allocation {dmd in DEMAND, t in PERIOD: t >=
MinPeriod[dmd] and t <= MaxPeriod[dmd]}:

  sum {(dmd,spec,prd) in GRADE_MIX, (t,spec,prd,orig,dest) in
WOODFLOW: dest = DemandDest[dmd]}

        U[t,spec,prd,orig,dest] = Demand[dmd];
#############


This is not working, I need help on this,

printf "\n";

printf "Log Allocation - Mill Demands \n";

printf "Period,Species,Products,Origin,Destination,Demand";

printf "\n";



for{dmd in DEMAND, t in PERIOD, (dmd,spec,prd) in GRADE_MIX,
(t,spec,prd,orig,dest) in WOODFLOW: dest = DemandDest[dmd]} {

  printf "%d,%s,%s,%s,%s,%.2f,%.2f,%.2f",

           t,spec,prd,orig,dest,

           (sum {(dmd,spec,prd) in GRADE_MIX, (t,spec,prd,orig,dest) in
WOODFLOW: dest =    DemandDest[dmd]} U[t,spec,prd,orig,dest]),

           Demand[dmd];

        printf "\n";

}

Any suggestion how to fix this thing above?

Thanks.

Noli



reply via email to

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